{"modulePath":"github.com/volatiletech/sqlboiler","version":"v3.7.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package strmangle\n\nPackage strmangle is a collection of string manipulation functions. Primarily used by boil and templates for code generation. Because it is focused on pipelining inside templates you will see some odd parameter ordering.\n\n## Functions\n\n```go\nfunc CamelCase(name string) string\n```\nCamelCase takes a variable name in the format of \"var\\_name\" and converts it into a go styled variable name of \"varName\". camelCase also fully uppercases \"ID\" components of names, for example \"var\\_name\\_id\" to \"varNameID\". It will also lowercase the first letter of the name in the case where it's fed something that starts with uppercase.\n\n```go\nfunc ContainsAny(a []string, finds ...string) bool\n```\nContainsAny returns true if any of the passed in strings are found in the passed in string slice\n\n```go\nfunc GenerateIgnoreTags(tags []string) string\n```\nGenerateIgnoreTags converts a slice of tag strings into ignore tags that can be passed onto the end of a struct, for example: tags: \\[\"xml\", \"db\"] convert to: xml:\"-\" db:\"-\"\n\n```go\nfunc GenerateTags(tags []string, columnName string) string\n```\nGenerateTags converts a slice of tag strings into tags that can be passed onto the end of a struct, for example: tags: \\[\"xml\", \"db\"] convert to: xml:\"column\\_name\" db:\"column\\_name\"\n\n```go\nfunc GetBuffer() *bytes.Buffer\n```\nGetBuffer retrieves a buffer from the buffer pool\n\n```go\nfunc IdentQuote(lq rune, rq rune, s string) string\n```\nIdentQuote attempts to quote simple identifiers in SQL statements\n\n```go\nfunc IdentQuoteSlice(lq rune, rq rune, s []string) []string\n```\nIdentQuoteSlice applies IdentQuote to a slice.\n\n```go\nfunc Identifier(in int) string\n```\nIdentifier is a base conversion from Base 10 integers to Base 26 integers that are represented by an alphabet from a-z See tests for example outputs.\n\n```go\nfunc Ignore(table, column string, ignoreList map[string]struct{}) bool\n```\nIgnore sets \"-\" for the tags values, so the fields will be ignored during parsing\n\n```go\nfunc IsEnumNormal(values []string) bool\n```\nIsEnumNormal checks a set of eval values to see if they're \"normal\"\n\n```go\nfunc JoinSlices(sep string, a, b []string) []string\n```\nJoinSlices merges two string slices of equal length\n\n```go\nfunc MakeStringMap(types map[string]string) string\n```\nMakeStringMap converts a map\\[string]string into the format: \"key\": \"value\", \"key\": \"value\"\n\n```go\nfunc ParseEnumName(s string) string\n```\nParseEnumName returns the name portion of an enum if it exists\n\nPostgres and MySQL drivers return different values psql:  enum.enum\\_name('values'...) mysql: enum('values'...) In the case of mysql, the name will never return anything\n\n```go\nfunc ParseEnumVals(s string) []string\n```\nParseEnumVals returns the values from an enum string\n\nPostgres and MySQL drivers return different values psql:  enum.enum\\_name('values'...) mysql: enum('values'...)\n\n```go\nfunc Placeholders(useIndexPlaceholders bool, count int, start int, group int) string\n```\nPlaceholders generates the SQL statement placeholders for in queries. For example, ($1,$2,$3),($4,$5,$6) etc. It will start counting placeholders at \"start\". If useIndexPlaceholders is false, it will convert to ? instead of $1 etc.\n\n```go\nfunc Plural(name string) string\n```\nPlural converts singular words to plural words (eg: person to people)\n\n```go\nfunc PrefixStringSlice(str string, strs []string) []string\n```\nPrefixStringSlice with the given str.\n\n```go\nfunc PutBuffer(buf *bytes.Buffer)\n```\nPutBuffer back into the buffer pool\n\n```go\nfunc QuoteCharacter(q rune) string\n```\nQuoteCharacter returns a string that allows the quote character to be embedded into a Go string that uses double quotes:\n\n```go\nfunc RemoveDuplicates(dedup []string) []string\n```\nRemoveDuplicates from a string slice\n\n```go\nfunc ReplaceReservedWords(word string) string\n```\nReplaceReservedWords takes a word and replaces it with word\\_ if it's found in the list of reserved words.\n\n```go\nfunc SchemaTable(lq, rq string, useSchema bool, schema string, table string) string\n```\nSchemaTable returns a table name with a schema prefixed if using a database that supports real schemas, for example, for Postgres: \"schema\\_name\".\"table\\_name\", for MS SQL: \\[schema\\_name].\\[table\\_name], versus simply \"table\\_name\" for MySQL (because it does not support real schemas)\n\n```go\nfunc SetComplement(a []string, b []string) []string\n```\nSetComplement subtracts the elements in b from a\n\n```go\nfunc SetInclude(str string, slice []string) bool\n```\nSetInclude checks to see if the string is found in the string slice\n\n```go\nfunc SetMerge(a []string, b []string) []string\n```\nSetMerge will return a merged slice without duplicates\n\n```go\nfunc SetParamNames(lq, rq string, start int, columns []string) string\n```\nSetParamNames takes a slice of columns and returns a comma separated list of parameter names for a template statement SET clause. eg: \"col1\"=$1, \"col2\"=$2, \"col3\"=$3\n\n```go\nfunc ShouldTitleCaseEnum(value string) bool\n```\nShouldTitleCaseEnum checks a value to see if it's title-case-able\n\n```go\nfunc Singular(name string) string\n```\nSingular converts plural words to singular words (eg: people to person)\n\n```go\nfunc SortByKeys(keys []string, strs []string) []string\n```\nSortByKeys returns a new ordered slice based on the keys ordering\n\n```go\nfunc StringMap(modifier func(string) string, strs []string) []string\n```\nStringMap maps a function over a slice of strings.\n\n```go\nfunc StringSliceMatch(a []string, b []string) bool\n```\nStringSliceMatch returns true if the length of both slices is the same, and the elements of both slices are the same. The elements can be in any order.\n\n```go\nfunc TitleCase(n string) string\n```\nTitleCase changes a snake-case variable name into a go styled object variable name of \"ColumnName\". titleCase also fully uppercases \"ID\" components of names, for example \"column\\_name\\_id\" to \"ColumnNameID\".\n\nNote: This method is ugly because it has been highly optimized, we found that it was a fairly large bottleneck when we were using regexp.\n\n```go\nfunc TitleCaseIdentifier(id string) string\n```\nTitleCaseIdentifier splits on dots and then titlecases each fragment. map titleCase (split c \".\")\n\n```go\nfunc WhereClause(lq, rq string, start int, cols []string) string\n```\nWhereClause returns the where clause using start as the $ flag index For example, if start was 2 output would be: \"colthing=$2 AND colstuff=$3\"\n\n```go\nfunc WhereClauseRepeated(lq, rq string, start int, cols []string, count int) string\n```\nWhereClauseRepeated returns the where clause repeated with OR clause using start as the $ flag index For example, if start was 2 output would be: \"(colthing=$2 AND colstuff=$3) OR (colthing=$4 AND colstuff=$5)\"\n\n","path":"github.com/volatiletech/sqlboiler/strmangle","name":"strmangle","synopsis":"Package strmangle is a collection of string manipulation functions.","isRedistributable":true}
