{"id":13509986,"url":"https://github.com/smallnest/gen","last_synced_at":"2025-05-15T12:04:51.076Z","repository":{"id":30199910,"uuid":"124219644","full_name":"smallnest/gen","owner":"smallnest","description":"Converts a database into gorm structs and RESTful api","archived":false,"fork":false,"pushed_at":"2023-04-24T10:18:15.000Z","size":21067,"stargazers_count":1433,"open_issues_count":29,"forks_count":231,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-14T19:01:16.606Z","etag":null,"topics":["database","databases","generator","gorm","rest","rest-api","restful","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallnest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-07T10:31:36.000Z","updated_at":"2025-04-08T16:58:18.000Z","dependencies_parsed_at":"2023-01-14T16:31:28.143Z","dependency_job_id":"3c045656-4aed-465f-ad3f-7ae9b1ed7a12","html_url":"https://github.com/smallnest/gen","commit_stats":{"total_commits":161,"total_committers":28,"mean_commits":5.75,"dds":"0.44720496894409933","last_synced_commit":"2ab666fa15c3d953cf659529584e1d20b3f04c89"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2Fgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2Fgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2Fgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2Fgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallnest","download_url":"https://codeload.github.com/smallnest/gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","databases","generator","gorm","rest","rest-api","restful","restful-api"],"created_at":"2024-08-01T02:01:20.114Z","updated_at":"2025-05-15T12:04:46.065Z","avatar_url":"https://github.com/smallnest.png","language":"Go","funding_links":[],"categories":["开源类库","Go","Open source library","rest-api"],"sub_categories":["代码生成","Code Generation"],"readme":"[comment]: \u003c\u003e (This is a generated file please edit source in ./templates)\n[comment]: \u003c\u003e (All modification will be lost, you have been warned)\n[comment]: \u003c\u003e ()\n## gen\n\n[![License](https://img.shields.io/badge/License-Apache%203.0-blue.svg)](https://opensource.org/licenses/Apache-3.0) [![GoDoc](https://godoc.org/github.com/smallnest/gen?status.png)](http://godoc.org/github.com/smallnest/gen)  [![travis](https://travis-ci.org/smallnest/gen.svg?branch=master)](https://travis-ci.org/smallnest/gen) [![Go Report Card](https://goreportcard.com/badge/github.com/smallnest/gen)](https://goreportcard.com/report/github.com/smallnest/gen)\n\nThe gen tool produces a CRUD (Create, read, update and delete) REST api project template from a given database. The gen tool will\nconnect to the db connection string analyze the database and generate the code based on the flags provided.\n\nBy reading details from the database about the column structure, gen generates a go compatible struct type\nwith the required column names, data types, and annotations.\n\nIt supports [gorm](https://github.com/jinzhu/gorm) tags and implements some usable methods. Generated data types include support for nullable columns [sql.NullX types](https://golang.org/pkg/database/sql/#NullBool) or [guregu null.X types](https://github.com/guregu/null)\nand the expected basic built in go types.\n\n`gen` is based / inspired by the work of Seth Shelnutt's [db2struct](https://github.com/Shelnutt2/db2struct), and Db2Struct is based/inspired by the work of ChimeraCoder's gojson package [gojson](https://github.com/ChimeraCoder/gojson).\n\n\n\n## CRUD Generation\nThis is a sample table contained within the ./example/sample.db Sqlite3 database. Using `gen` will generate the following struct.\n```sql\nCREATE TABLE \"albums\"\n(\n    [AlbumId]  INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n    [Title]    NVARCHAR(160) NOT NULL,\n    [ArtistId] INTEGER NOT NULL,\n    FOREIGN KEY ([ArtistId]) REFERENCES \"artists\" ([ArtistId])\n\t\tON DELETE NO ACTION ON UPDATE NO ACTION\n)\n```\n#### Transforms into\n```go\ntype Album struct {\n\t//[ 0] AlbumId                                        integer              null: false  primary: true   auto: true   col: integer         len: -1      default: []\n\tAlbumID int `gorm:\"primary_key;AUTO_INCREMENT;column:AlbumId;type:INTEGER;\" json:\"album_id\" db:\"AlbumId\" protobuf:\"int32,0,opt,name=album_id\"`\n\t//[ 1] Title                                          nvarchar(160)        null: false  primary: false  auto: false  col: nvarchar        len: 160     default: []\n\tTitle string `gorm:\"column:Title;type:NVARCHAR(160);size:160;\" json:\"title\" db:\"Title\" protobuf:\"string,1,opt,name=title\"`\n\t//[ 2] ArtistId                                       integer              null: false  primary: false  auto: false  col: integer         len: -1      default: []\n\tArtistID int `gorm:\"column:ArtistId;type:INTEGER;\" json:\"artist_id\" db:\"ArtistId\" protobuf:\"int32,2,opt,name=artist_id\"`\n}\n```\nCode generation for a complete CRUD rest project is possible with DAO crud functions, http handlers, makefile, sample server are available. Check out some of the [code generated samples](#Generated-Samples).\n\n\n\n## Binary Installation\n```BASH\n## install gen tool (should be installed to ~/go/bin, make sure ~/go/bin is in your path.\n\n## go version \u003c 1.17\n$ go get -u github.com/smallnest/gen\n\n## go version == 1.17\n$ go install github.com/smallnest/gen@latest\n\n## download sample sqlite database\n$ wget https://github.com/smallnest/gen/raw/master/example/sample.db\n\n## generate code based on the sqlite database (project will be contained within the ./example dir)\n$ gen --sqltype=sqlite3 \\\n   \t--connstr \"./sample.db\" \\\n   \t--database main  \\\n   \t--json \\\n   \t--gorm \\\n   \t--guregu \\\n   \t--rest \\\n   \t--out ./example \\\n   \t--module example.com/rest/example \\\n   \t--mod \\\n   \t--server \\\n   \t--makefile \\\n   \t--json-fmt=snake \\\n   \t--generate-dao \\\n   \t--generate-proj \\\n   \t--overwrite\n\n## build example code (build process will install packr2 if not installed)\n$ cd ./example\n$ make example\n\n## binary will be located at ./bin/example\n## when launching make sure that the SQLite file sample.db is located in the same dir as the binary\n$ cp ../../sample.db  .\n$ ./example\n\n\n## Open a browser to http://127.0.0.1:8080/swagger/index.html\n\n## Use wget/curl/httpie to fetch via command line\nhttp http://localhost:8080/albums\ncurl http://localhost:8080/artists\n\n```\n\n\n## Usage\n```console\nUsage of gen:\n\tgen [-v] --sqltype=mysql --connstr \"user:password@/dbname\" --database \u003cdatabaseName\u003e --module=example.com/example [--json] [--gorm] [--guregu] [--generate-dao] [--generate-proj]\ngit fetch up\n           sqltype - sql database type such as [ mysql, mssql, postgres, sqlite, etc. ]\n\n\nOptions:\n  --sqltype=mysql                                          sql database type such as [ mysql, mssql, postgres, sqlite, etc. ]\n  -c, --connstr=nil                                        database connection string\n  -d, --database=nil                                       Database to for connection\n  -t, --table=                                             Table to build struct from\n  -x, --exclude=                                           Table(s) to exclude\n  --templateDir=                                           Template Dir\n  --fragmentsDir=                                          Code fragments Dir\n  --save=                                                  Save templates to dir\n  --model=model                                            name to set for model package\n  --model_naming={{FmtFieldName .}}                        model naming template to name structs\n  --field_naming={{FmtFieldName (stringifyFirstChar .) }}  field naming template to name structs\n  --file_naming={{.}}                                      file_naming template to name files\n  --dao=dao                                                name to set for dao package\n  --api=api                                                name to set for api package\n  --grpc=grpc                                              name to set for grpc package\n  --out=.                                                  output dir\n  --module=example.com/example                             module path\n  --overwrite                                              Overwrite existing files (default)\n  --no-overwrite                                           disable overwriting files\n  --windows                                                use windows line endings in generated files\n  --no-color                                               disable color output\n  --context=                                               context file (json) to populate context with\n  --mapping=                                               mapping file (json) to map sql types to golang/protobuf etc\n  --exec=                                                  execute script for custom code generation\n  --json                                                   Add json annotations (default)\n  --no-json                                                Disable json annotations\n  --json-fmt=snake                                         json name format [snake | camel | lower_camel | none]\n  --xml                                                    Add xml annotations (default)\n  --no-xml                                                 Disable xml annotations\n  --xml-fmt=snake                                          xml name format [snake | camel | lower_camel | none]\n  --gorm                                                   Add gorm annotations (tags)\n  --protobuf                                               Add protobuf annotations (tags)\n  --proto-fmt=snake                                        proto name format [snake | camel | lower_camel | none]\n  --gogo-proto=                                            location of gogo import \n  --db                                                     Add db annotations (tags)\n  --guregu                                                 Add guregu null types\n  --copy-templates                                         Copy regeneration templates to project directory\n  --mod                                                    Generate go.mod in output dir\n  --makefile                                               Generate Makefile in output dir\n  --server                                                 Generate server app output dir\n  --generate-dao                                           Generate dao functions\n  --generate-proj                                          Generate project readme and gitignore\n  --rest                                                   Enable generating RESTful api\n  --run-gofmt                                              run gofmt on output dir\n  --listen=                                                listen address e.g. :8080\n  --scheme=http                                            scheme for server url\n  --host=localhost                                         host for server\n  --port=8080                                              port for server\n  --swagger_version=1.0                                    swagger version\n  --swagger_path=/                                         swagger base path\n  --swagger_tos=                                           swagger tos url\n  --swagger_contact_name=Me                                swagger contact name\n  --swagger_contact_url=http://me.com/terms.html           swagger contact url\n  --swagger_contact_email=me@me.com                        swagger contact email\n  -v, --verbose                                            Enable verbose output\n  --name_test=                                             perform name test using the --model_naming or --file_naming options\n  -h, --help                                               Show usage message\n  --version                                                Show version\n\n\n```\n\n## Building\nThe project contains a makefile for easy building and common tasks.\n* `go get` - get the relevant dependencies as a \"go\" software\n* `make help` - list available targets\n* `make build` - generate the binary `./gen`\n* `make example` - run the gen process on the example SqlLite db located in ./examples place the sources in ./example\nOther targets exist for dev tasks.\n\n## Example\nThe project provides a sample SQLite database in the `./example` directory. From the project `Makefile` can be used to generate the example code.\n```.bash\nmake example\n```\n\nThe generated project will contain the following code under the `./example` directory.\n* Makefile\n  * useful Makefile for installing tools building project etc. Issue `make` to display help output.\n* .gitignore\n  * git ignore for go project\n* go.mod\n  * go module setup, pass `--module` flag for setting the project module default `example.com/example`\n* README.md\n  * Project readme\n* app/server/main.go\n  * Sample Gin Server, with swagger init and comments\n* api/\u003ctable name\u003e.go\n  * REST crud controllers\n* dao/\u003ctable name\u003e.go\n  * DAO functions providing CRUD access to database\n* model/\u003ctable name\u003e.go\n  * Structs representing a row for each database table\n\n\n#### Generated Samples\n* [GORM DAO CRUD Functions](./code_dao_gorm.md)\n* [SQLX DAO CRUD Functions](./code_dao_sqlx.md)\n* [Http CRUD Handlers](./code_http.md)\n* [Model](./code_model.md)\n* [Protobuf Definition](./code_protobuf.md)\n\n\nThe REST api server utilizes the Gin framework, GORM db api and Swag for providing swagger documentation\n* [Gin](https://github.com/gin-gonic/gin)\n* [Swaggo](https://github.com/swaggo/swag)\n* [Gorm](https://github.com/jinzhu/gorm)\n* [packr2](https://github.com/gobuffalo/packr)\n\n\n\n## Supported Databases\nCurrently Supported,\n- MariaDB\n- MySQL\n- PostgreSQL\n- Microsoft SQL Server\n- SQLite\n\nPlanned Support\n- Oracle\n\n## Supported Data Types\n\nMost data types are supported, for Mysql, Postgres, SQLite and MS SQL. `gen` uses a mapping json file that can be used to add mapping types. By default, the internal mapping file is loaded and processed. If can be overwritten or additional types added by using the `--mapping=extra.json` command line option.\n\nThe default `mapping.json` file is located within the ./templates dir. Use `gen --save=./templates` to save the contents of the templates to `./templates`.\nBelow is a portion of the mapping file, showing the mapping for `varchar`.\n\n```json\n    {\n      \"sql_type\": \"varchar\",\n      \"go_type\": \"string\",\n      \"protobuf_type\": \"bytes\",\n      \"guregu_type\": \"null.String\",\n      \"go_nullable_type\": \"sql.NullString\"\n    }\n```\n\n\n## Advanced\nThe `gen` tool provides functionality to layout your own project format. Users have 2 options.\n* Provide local templates with the `--templateDir=` option - this will generate code using the local templates. Templates can either be exported from `gen`\nvia the command `gen --save ./mytemplates`. This will save the embedded templates for local editing. Then you would specify the `--templateDir=` option when generating a project.\n\n* Passing `--exec=../sample.gen` on the command line will load the `sample.gen` script and execute it. The script has access to the table information and other info passed to `gen`. This allows developers to customize the generation of code. You could loop through the list of tables and invoke\n`GenerateTableFile` or  `GenerateFile`. You can also perform operations such as mkdir, copy, touch, pwd.\n\n\n### Example - generate files from a template looping thru a map of tables.\nLoop thru map of tables, key is the table name and value is ModelInfo. Creating a file using the table ModelInfo.\n\n`tableInfos := map[string]*ModelInfo`\n\n`GenerateTableFile(tableInfos map[string]*ModelInfo, tableName, templateFilename, outputDirectory, outputFileName string, formatOutput bool)`\n\n```\n\n{{ range $tableName , $table := .tableInfos }}\n   {{$i := inc }}\n   {{$name := toUpper $table.TableName -}}\n   {{$filename  := printf \"My%s.go\" $name -}}\n\n   {{ GenerateTableFile $.tableInfos $table.TableName  \"custom.go.tmpl\" \"test\" $filename true}}{{- end }}\n\n```\n\n### Example - generate file from a template.\n`GenerateFile(templateFilename, outputDirectory, outputFileName string, formatOutput bool, overwrite bool)`\n```\n\n{{ GenerateFile \"custom.md.tmpl\" \"test\" \"custom.md\" false false }}\n\n```\n\n### Example - make a directory.\n```\n\n{{ mkdir \"test/alex/test/mkdir\" }}\n\n```\n\n### Example - touch a file.\n```\n\n{{ touch \"test/alex/test/mkdir/alex.txt\" }}\n\n```\n\n### Example - display working directory.\n```\n\n{{ pwd }}\n\n```\n\n### Example - copy a file or directory from source to a target directory.\ncopy function updated to provide --include and --exclude patterns. Patterns are processed in order, an include preceeding an exclude will take precedence. Multiple include and excludes can be specified. Files ending with .table.tmpl will be processed for each table. Output filenames will be stored in the proper directory, with a name of the table with the suffix of the template extension. Files ending with .tmpl will be processed as a template and the filename will be the name of the template stripped with the .tmpl suffix.\n\n```\n\n{{ copy \"../_test\" \"test\" }}\n\n{{ copy \"./backend\" \"test/backend\" \"--exclude .idea|commands\" \"--exclude go.sum\"  \"--include .*\" }}\n\n{{ copy \"./backend\" \"test/backend\" \"--include backend\" \"--include go.mod\" \"--exclude .*\"  }}\n\n\n```\n\n\nYou can also populate the context used by templates with extra data by passing the `--context=\u003cjson file\u003e` option. The json file will be used to populate the context used when parsing templates.\n\n### File Generation\n```gotemplate\n// Loop through tables and print out table name and various forms of the table name\n\n{{ range $i, $table := .tables }}\n    {{$singular   := singular $table -}}\n    {{$plural     := pluralize $table -}}\n    {{$title      := title $table -}}\n    {{$lower      := toLower $table -}}\n    {{$lowerCamel := toLowerCamelCase $table -}}\n    {{$snakeCase  := toSnakeCase $table -}}\n    {{ printf \"[%-2d] %-20s %-20s %-20s %-20s %-20s %-20s %-20s\" $i $table $singular $plural $title $lower $lowerCamel $snakeCase}}{{- end }}\n\n\n{{ range $i, $table := .tables }}\n   {{$name := toUpper $table -}}\n   {{$filename  := printf \"My%s\" $name -}}\n   {{ printf \"[%-2d] %-20s %-20s\" $i $table $filename}}\n   {{ GenerateTableFile $table  \"custom.go.tmpl\" \"test\" $filename true}}\n{{- end }}\n\n\n// GenerateTableFile(tableInfos map[string]*ModelInfo, tableName, templateFilename, outputDirectory, outputFileName string, formatOutput bool)\n// GenerateFile(templateFilename, outputDirectory, outputFileName string, formatOutput bool, overwrite bool)\n\nThe following info is available within use of the exec template.\n\n\n   \"AdvancesSample\"            string                         \"\\n{{ range $i, $table := .tables }}\\n    {{$singular   := singular $table -}}\\n    {{$plural     := pluralize $table -}}\\n    {{$title      := title $table -}}\\n    {{$lower      := toLower $table -}}\\n    {{$lowerCamel := toLowerCamelCase $table -}}\\n    {{$snakeCase  := toSnakeCase $table -}}\\n    {{ printf \\\"[%-2d] %-20s %-20s %-20s %-20s %-20s %-20s %-20s\\\" $i $table $singular $plural $title $lower $lowerCamel $snakeCase}}{{- end }}\\n\\n\\n{{ range $i, $table := .tables }}\\n   {{$name := toUpper $table -}}\\n   {{$filename  := printf \\\"My%s\\\" $name -}}\\n   {{ printf \\\"[%-2d] %-20s %-20s\\\" $i $table $filename}}\\n   {{ GenerateTableFile $table  \\\"custom.go.tmpl\\\" \\\"test\\\" $filename true}}\\n{{- end }}\\n\"\n   \"Config\"                    *dbmeta.Config                 \u0026dbmeta.Config{SQLType:\"sqlite3\", SQLConnStr:\"./example/sample.db\", SQLDatabase:\"main\", Module:\"github.com/alexj212/test\", ModelPackageName:\"model\", ModelFQPN:\"github.com/alexj212/test/model\", AddJSONAnnotation:true, AddGormAnnotation:true, AddProtobufAnnotation:true, AddXMLAnnotation:true, AddDBAnnotation:true, UseGureguTypes:false, JSONNameFormat:\"snake\", XMLNameFormat:\"snake\", ProtobufNameFormat:\"\", DaoPackageName:\"dao\", DaoFQPN:\"github.com/alexj212/test/dao\", APIPackageName:\"api\", APIFQPN:\"github.com/alexj212/test/api\", GrpcPackageName:\"\", GrpcFQPN:\"\", Swagger:(*dbmeta.SwaggerInfoDetails)(0xc000ad0510), ServerPort:8080, ServerHost:\"127.0.0.1\", ServerScheme:\"http\", ServerListen:\":8080\", Verbose:false, OutDir:\".\", Overwrite:true, LineEndingCRLF:false, CmdLine:\"/tmp/go-build271698611/b001/exe/readme --sqltype=sqlite3 --connstr ./example/sample.db --database main --table invoices\", CmdLineWrapped:\"/tmp/go-build271698611/b001/exe/readme \\\\\\n    --sqltype=sqlite3 \\\\\\n    --connstr \\\\\\n    ./example/sample.db \\\\\\n    --database \\\\\\n    main \\\\\\n    --table \\\\\\n    invoices\", CmdLineArgs:[]string{\"/tmp/go-build271698611/b001/exe/readme\", \"--sqltype=sqlite3\", \"--connstr\", \"./example/sample.db\", \"--database\", \"main\", \"--table\", \"invoices\"}, FileNamingTemplate:\"{{.}}\", ModelNamingTemplate:\"{{FmtFieldName .}}\", FieldNamingTemplate:\"{{FmtFieldName (stringifyFirstChar .) }}\", ContextMap:map[string]interface {}{\"GenHelp\":\"Usage of gen:\\n\\tgen [-v] --sqltype=mysql --connstr \\\"user:password@/dbname\\\" --database \u003cdatabaseName\u003e --module=example.com/example [--json] [--gorm] [--guregu] [--generate-dao] [--generate-proj]\\ngit fetch up\\n           sqltype - sql database type such as [ mysql, mssql, postgres, sqlite, etc. ]\\n\\n\\nOptions:\\n  --sqltype=mysql                                          sql database type such as [ mysql, mssql, postgres, sqlite, etc. ]\\n  -c, --connstr=nil                                        database connection string\\n  -d, --database=nil                                       Database to for connection\\n  -t, --table=                                             Table to build struct from\\n  -x, --exclude=                                           Table(s) to exclude\\n  --templateDir=                                           Template Dir\\n  --save=                                                  Save templates to dir\\n  --model=model                                            name to set for model package\\n  --model_naming={{FmtFieldName .}}                        model naming template to name structs\\n  --field_naming={{FmtFieldName (stringifyFirstChar .) }}  field naming template to name structs\\n  --file_naming={{.}}                                      file_naming template to name files\\n  --dao=dao                                                name to set for dao package\\n  --api=api                                                name to set for api package\\n  --grpc=grpc                                              name to set for grpc package\\n  --out=.                                                  output dir\\n  --module=example.com/example                             module path\\n  --overwrite                                              Overwrite existing files (default)\\n  --no-overwrite                                           disable overwriting files\\n  --windows                                                use windows line endings in generated files\\n  --no-color                                               disable color output\\n  --context=                                               context file (json) to populate context with\\n  --mapping=                                               mapping file (json) to map sql types to golang/protobuf etc\\n  --exec=                                                  execute script for custom code generation\\n  --json                                                   Add json annotations (default)\\n  --no-json                                                Disable json annotations\\n  --json-fmt=snake                                         json name format [snake | camel | lower_camel | none]\\n  --xml                                                    Add xml annotations (default)\\n  --no-xml                                                 Disable xml annotations\\n  --xml-fmt=snake                                          xml name format [snake | camel | lower_camel | none]\\n  --gorm                                                   Add gorm annotations (tags)\\n  --protobuf                                               Add protobuf annotations (tags)\\n  --proto-fmt=snake                                        proto name format [snake | camel | lower_camel | none]\\n  --gogo-proto=                                            location of gogo import \\n  --db                                                     Add db annotations (tags)\\n  --guregu                                                 Add guregu null types\\n  --copy-templates                                         Copy regeneration templates to project directory\\n  --mod                                                    Generate go.mod in output dir\\n  --makefile                                               Generate Makefile in output dir\\n  --server                                                 Generate server app output dir\\n  --generate-dao                                           Generate dao functions\\n  --generate-proj                                          Generate project readme and gitignore\\n  --rest                                                   Enable generating RESTful api\\n  --run-gofmt                                              run gofmt on output dir\\n  --listen=                                                listen address e.g. :8080\\n  --scheme=http                                            scheme for server url\\n  --host=localhost                                         host for server\\n  --port=8080                                              port for server\\n  --swagger_version=1.0                                    swagger version\\n  --swagger_path=/                                         swagger base path\\n  --swagger_tos=                                           swagger tos url\\n  --swagger_contact_name=Me                                swagger contact name\\n  --swagger_contact_url=http://me.com/terms.html           swagger contact url\\n  --swagger_contact_email=me@me.com                        swagger contact email\\n  -v, --verbose                                            Enable verbose output\\n  --name_test=                                             perform name test using the --model_naming or --file_naming options\\n  -h, --help                                               Show usage message\\n  --version                                                Show version\\n\\n\", \"tableInfos\":map[string]*dbmeta.ModelInfo{\"invoices\":(*dbmeta.ModelInfo)(0xc0001e94a0)}}, TemplateLoader:(dbmeta.TemplateLoader)(0x8a7e40), TableInfos:map[string]*dbmeta.ModelInfo(nil)}\n   \"DatabaseName\"              string                         \"main\"\n   \"Dir\"                       string                         \".\"\n   \"File\"                      string                         \"./README.md\"\n   \"GenHelp\"                   string                         \"Usage of gen:\\n\\tgen [-v] --sqltype=mysql --connstr \\\"user:password@/dbname\\\" --database \u003cdatabaseName\u003e --module=example.com/example [--json] [--gorm] [--guregu] [--generate-dao] [--generate-proj]\\ngit fetch up\\n           sqltype - sql database type such as [ mysql, mssql, postgres, sqlite, etc. ]\\n\\n\\nOptions:\\n  --sqltype=mysql                                          sql database type such as [ mysql, mssql, postgres, sqlite, etc. ]\\n  -c, --connstr=nil                                        database connection string\\n  -d, --database=nil                                       Database to for connection\\n  -t, --table=                                             Table to build struct from\\n  -x, --exclude=                                           Table(s) to exclude\\n  --templateDir=                                           Template Dir\\n  --save=                                                  Save templates to dir\\n  --model=model                                            name to set for model package\\n  --model_naming={{FmtFieldName .}}                        model naming template to name structs\\n  --field_naming={{FmtFieldName (stringifyFirstChar .) }}  field naming template to name structs\\n  --file_naming={{.}}                                      file_naming template to name files\\n  --dao=dao                                                name to set for dao package\\n  --api=api                                                name to set for api package\\n  --grpc=grpc                                              name to set for grpc package\\n  --out=.                                                  output dir\\n  --module=example.com/example                             module path\\n  --overwrite                                              Overwrite existing files (default)\\n  --no-overwrite                                           disable overwriting files\\n  --windows                                                use windows line endings in generated files\\n  --no-color                                               disable color output\\n  --context=                                               context file (json) to populate context with\\n  --mapping=                                               mapping file (json) to map sql types to golang/protobuf etc\\n  --exec=                                                  execute script for custom code generation\\n  --json                                                   Add json annotations (default)\\n  --no-json                                                Disable json annotations\\n  --json-fmt=snake                                         json name format [snake | camel | lower_camel | none]\\n  --xml                                                    Add xml annotations (default)\\n  --no-xml                                                 Disable xml annotations\\n  --xml-fmt=snake                                          xml name format [snake | camel | lower_camel | none]\\n  --gorm                                                   Add gorm annotations (tags)\\n  --protobuf                                               Add protobuf annotations (tags)\\n  --proto-fmt=snake                                        proto name format [snake | camel | lower_camel | none]\\n  --gogo-proto=                                            location of gogo import \\n  --db                                                     Add db annotations (tags)\\n  --guregu                                                 Add guregu null types\\n  --copy-templates                                         Copy regeneration templates to project directory\\n  --mod                                                    Generate go.mod in output dir\\n  --makefile                                               Generate Makefile in output dir\\n  --server                                                 Generate server app output dir\\n  --generate-dao                                           Generate dao functions\\n  --generate-proj                                          Generate project readme and gitignore\\n  --rest                                                   Enable generating RESTful api\\n  --run-gofmt                                              run gofmt on output dir\\n  --listen=                                                listen address e.g. :8080\\n  --scheme=http                                            scheme for server url\\n  --host=localhost                                         host for server\\n  --port=8080                                              port for server\\n  --swagger_version=1.0                                    swagger version\\n  --swagger_path=/                                         swagger base path\\n  --swagger_tos=                                           swagger tos url\\n  --swagger_contact_name=Me                                swagger contact name\\n  --swagger_contact_url=http://me.com/terms.html           swagger contact url\\n  --swagger_contact_email=me@me.com                        swagger contact email\\n  -v, --verbose                                            Enable verbose output\\n  --name_test=                                             perform name test using the --model_naming or --file_naming options\\n  -h, --help                                               Show usage message\\n  --version                                                Show version\\n\\n\"\n   \"NonPrimaryKeyNamesList\"    []string                       []string{\"CustomerId\", \"InvoiceDate\", \"BillingAddress\", \"BillingCity\", \"BillingState\", \"BillingCountry\", \"BillingPostalCode\", \"Total\"}\n   \"NonPrimaryKeysJoined\"      string                         \"CustomerId,InvoiceDate,BillingAddress,BillingCity,BillingState,BillingCountry,BillingPostalCode,Total\"\n   \"Parent\"                    string                         \".\"\n   \"PrimaryKeyNamesList\"       []string                       []string{\"InvoiceId\"}\n   \"PrimaryKeysJoined\"         string                         \"InvoiceId\"\n   \"ReleaseHistory\"            string                         \"- v0.9.27 (08/04/2020)\\n    - Updated '--exec' mode to provide various functions for processing\\n    - copy function updated to provide --include and --exclude patterns. Patterns are processed in order, an include preceeding an exclude will take precedence. Multiple include and excludes can be specified. Files ending with .table.tmpl will be processed for each table. Output filenames will be stored in the proper directory, with a name of the table with the suffix of the template extension. Files ending with .tmpl will be processed as a template and the filename will be the name of the template stripped with the .tmpl suffix. \\n    - When processing templates, files generated with a .go extension will be formatted with the go fmt.\\n- v0.9.26 (07/31/2020)\\n    - Release scripting\\n    - Added custom script functions to copy, mkdir, touch, pwd\\n    - Fixed custom script exec example\\n- v0.9.25 (07/26/2020)\\n    - Adhere json-fmt flag for all JSON response so when camel or lower_camel is specified, fields name in GetAll variant and DDL info will also have the same name format\\n    - Fix: Build information embedded through linker in Makefile is not consistent with the variable defined in main file.\\n    - Added --scheme and --listen options. This allows compiled binary to be used behind reverse proxy.\\n    - In addition, template for generating URL was fixed, i.e. when PORT is 80, then PORT is omitted from URL segment.\\n- v0.9.24 (07/13/2020)\\n    - Fixed array bounds issue parsing mysql db meta\\n- v0.9.23 (07/10/2020)\\n    - Added postgres types: bigserial, serial, smallserial, bigserial, float4 to mapping.json\\n- v0.9.22 (07/08/2020)\\n    - Modified gogo.proto check to use GOPATH not hardcoded.\\n    - Updated gen to error exit on first error encountered\\n    - Added color output for error\\n    - Added --no-color option for non colorized output\\n- v0.9.21 (07/07/2020)\\n    - Repacking templates, update version number in info.\\n- v0.9.20 (07/07/2020)\\n    - Fixed render error in router.go.tmpl\\n    - upgraded project to use go.mod 1.14\\n- v0.9.19 (07/07/2020)\\n    - Added --windows flag to write files with CRLF windows line endings, otherwise they are all unix based LF line endings\\n- v0.9.18 (06/30/2020)\\n    - Fixed naming in templates away from hard coded model package.\\n- v0.9.17 (06/30/2020)\\n    - Refactored template loading, to better report error in template\\n    - Added option to run gofmt on output directory\\n- v0.9.16 (06/29/2020)\\n    - Fixes to router.go.tmpl from calvinchengx\\n    - Added postgres db support for inet and timestamptz\\n- v0.9.15 (06/23/2020)\\n    - Code cleanup using gofmt name suggestions.\\n    - Template updates for generated code cleanup using gofmt name suggestions.\\n- v0.9.14 (06/23/2020)\\n    - Added model comment on field line if available from database.\\n    - Added exposing TableInfo via api call.\\n- v0.9.13 (06/22/2020)\\n    - fixed closing of connections via defer\\n    - bug fixes in sqlx generated code\\n- v0.9.12 (06/14/2020)\\n    - SQLX changed MustExec to Exec and checking/returning error\\n    - Updated field renaming if duplicated, need more elegant renaming solution.\\n    - Added exclude to test.sh\\n- v0.9.11 (06/13/2020)\\n    - Added ability to pass field, model and file naming format\\n    - updated test scripts\\n    - Fixed sqlx sql query placeholders\\n- v0.9.10 (06/11/2020)\\n    - Bug fix with retrieving varchar length from mysql\\n    - Added support for mysql unsigned decimal - maps to float\\n- v0.9.9 (06/11/2020)\\n    - Fixed issue with mysql and table named `order`\\n    - Fixed internals in GetAll generation in gorm and sqlx.\\n- v0.9.8 (06/10/2020)\\n    - Added ability to set file naming convention for models, dao, apis and grpc  `--file_naming={{.}}`\\n    - Added ability to set struct naming convention `--model_naming={{.}}`\\n    - Fixed bug with Makefile generation removing quoted conn string in `make regen`\\n- v0.9.7 (06/09/2020)\\n    - Added grpc server generation - WIP (looking for code improvements)\\n    - Added ability to exclude tables\\n    - Added support for unsigned from mysql ddl.\\n- v0.9.6 (06/08/2020)\\n    - Updated SQLX codegen\\n    - Updated templates to split code gen functions into seperate files\\n    - Added code_dao_gorm, code_dao_sqlx to be generated from templates\\n- v0.9.5 (05/16/2020)\\n    - Added SQLX codegen by default, split dao templates.\\n    - Renamed templates\\n- v0.9.4 (05/15/2020)\\n    - Documentation updates, samples etc.\\n- v0.9.3 (05/14/2020)\\n    - Template bug fixes, when using custom api, dao and model package.\\n    - Set primary key if not set to the first column\\n    - Skip code gen if primary key column is not int or string\\n    - validated codegen for mysql, mssql, postgres and sqlite3\\n    - Fixed file naming if table ends with _test.go renames to _tst.go\\n    - Fix for duplicate field names in struct due to renaming\\n    - Added Notes for columns and tables for situations where a primary key is set since not defined in db\\n    - Fixed issue when model contained field that had were named the same as funcs within model.\\n- v0.9.2 (05/12/2020)\\n    - Code cleanup gofmt, etc.\\n- v0.9.1 (05/12/2020)\\n- v0.9 (05/12/2020)\\n    - updated db meta data loading fetching default values\\n    - added default value to GORM tags\\n    - Added protobuf .proto generation\\n    - Added test app to display meta data\\n    - Cleanup DDL generation\\n    - Added support for varchar2, datetime2, float8, USER_DEFINED\\n- v0.5\\n\"\n   \"ShortStructName\"           string                         \"i\"\n   \"StructName\"                string                         \"Invoices\"\n   \"SwaggerInfo\"               *dbmeta.SwaggerInfoDetails     \u0026dbmeta.SwaggerInfoDetails{Version:\"1.0.0\", Host:\"127.0.0.1:8080\", BasePath:\"/\", Title:\"Sample CRUD api for main db\", Description:\"Sample CRUD api for main db\", TOS:\"My Custom TOS\", ContactName:\"\", ContactURL:\"\", ContactEmail:\"\"}\n   \"TableInfo\"                 *dbmeta.ModelInfo              \u0026dbmeta.ModelInfo{Index:0, IndexPlus1:1, PackageName:\"model\", StructName:\"Invoices\", ShortStructName:\"i\", TableName:\"invoices\", Fields:[]string{\"//[ 0] InvoiceId                                      integer              null: false  primary: true   isArray: false  auto: true   col: integer         len: -1      default: []\\n    InvoiceID int32 `gorm:\\\"primary_key;AUTO_INCREMENT;column:InvoiceId;type:integer;\\\" json:\\\"invoice_id\\\" xml:\\\"invoice_id\\\" db:\\\"InvoiceId\\\" protobuf:\\\"int32,0,opt,name=InvoiceId\\\"`\", \"//[ 1] CustomerId                                     integer              null: false  primary: false  isArray: false  auto: false  col: integer         len: -1      default: []\\n    CustomerID int32 `gorm:\\\"column:CustomerId;type:integer;\\\" json:\\\"customer_id\\\" xml:\\\"customer_id\\\" db:\\\"CustomerId\\\" protobuf:\\\"int32,1,opt,name=CustomerId\\\"`\", \"//[ 2] InvoiceDate                                    datetime             null: false  primary: false  isArray: false  auto: false  col: datetime        len: -1      default: []\\n    InvoiceDate time.Time `gorm:\\\"column:InvoiceDate;type:datetime;\\\" json:\\\"invoice_date\\\" xml:\\\"invoice_date\\\" db:\\\"InvoiceDate\\\" protobuf:\\\"google.protobuf.Timestamp,2,opt,name=InvoiceDate\\\"`\", \"//[ 3] BillingAddress                                 nvarchar(70)         null: true   primary: false  isArray: false  auto: false  col: nvarchar        len: 70      default: []\\n    BillingAddress sql.NullString `gorm:\\\"column:BillingAddress;type:nvarchar;size:70;\\\" json:\\\"billing_address\\\" xml:\\\"billing_address\\\" db:\\\"BillingAddress\\\" protobuf:\\\"string,3,opt,name=BillingAddress\\\"`\", \"//[ 4] BillingCity                                    nvarchar(40)         null: true   primary: false  isArray: false  auto: false  col: nvarchar        len: 40      default: []\\n    BillingCity sql.NullString `gorm:\\\"column:BillingCity;type:nvarchar;size:40;\\\" json:\\\"billing_city\\\" xml:\\\"billing_city\\\" db:\\\"BillingCity\\\" protobuf:\\\"string,4,opt,name=BillingCity\\\"`\", \"//[ 5] BillingState                                   nvarchar(40)         null: true   primary: false  isArray: false  auto: false  col: nvarchar        len: 40      default: []\\n    BillingState sql.NullString `gorm:\\\"column:BillingState;type:nvarchar;size:40;\\\" json:\\\"billing_state\\\" xml:\\\"billing_state\\\" db:\\\"BillingState\\\" protobuf:\\\"string,5,opt,name=BillingState\\\"`\", \"//[ 6] BillingCountry                                 nvarchar(40)         null: true   primary: false  isArray: false  auto: false  col: nvarchar        len: 40      default: []\\n    BillingCountry sql.NullString `gorm:\\\"column:BillingCountry;type:nvarchar;size:40;\\\" json:\\\"billing_country\\\" xml:\\\"billing_country\\\" db:\\\"BillingCountry\\\" protobuf:\\\"string,6,opt,name=BillingCountry\\\"`\", \"//[ 7] BillingPostalCode                              nvarchar(10)         null: true   primary: false  isArray: false  auto: false  col: nvarchar        len: 10      default: []\\n    BillingPostalCode sql.NullString `gorm:\\\"column:BillingPostalCode;type:nvarchar;size:10;\\\" json:\\\"billing_postal_code\\\" xml:\\\"billing_postal_code\\\" db:\\\"BillingPostalCode\\\" protobuf:\\\"string,7,opt,name=BillingPostalCode\\\"`\", \"//[ 8] Total                                          numeric              null: false  primary: false  isArray: false  auto: false  col: numeric         len: -1      default: []\\n    Total float64 `gorm:\\\"column:Total;type:numeric;\\\" json:\\\"total\\\" xml:\\\"total\\\" db:\\\"Total\\\" protobuf:\\\"float,8,opt,name=Total\\\"`\"}, DBMeta:(*dbmeta.dbTableMeta)(0xc000133b00), Instance:(*struct { BillingState string \"json:\\\"billing_state\\\"\"; BillingCountry string \"json:\\\"billing_country\\\"\"; BillingPostalCode string \"json:\\\"billing_postal_code\\\"\"; CustomerID int \"json:\\\"customer_id\\\"\"; InvoiceDate time.Time \"json:\\\"invoice_date\\\"\"; BillingAddress string \"json:\\\"billing_address\\\"\"; BillingCity string \"json:\\\"billing_city\\\"\"; Total float64 \"json:\\\"total\\\"\"; InvoiceID int \"json:\\\"invoice_id\\\"\" })(0xc000a85700), CodeFields:[]*dbmeta.FieldInfo{(*dbmeta.FieldInfo)(0xc00025c640), (*dbmeta.FieldInfo)(0xc00025c780), (*dbmeta.FieldInfo)(0xc00025c8c0), (*dbmeta.FieldInfo)(0xc00025ca00), (*dbmeta.FieldInfo)(0xc00025cb40), (*dbmeta.FieldInfo)(0xc00025cc80), (*dbmeta.FieldInfo)(0xc00025cdc0), (*dbmeta.FieldInfo)(0xc00025cf00), (*dbmeta.FieldInfo)(0xc00025d040)}}\n   \"TableName\"                 string                         \"invoices\"\n   \"apiFQPN\"                   string                         \"github.com/alexj212/test/api\"\n   \"apiPackageName\"            string                         \"api\"\n   \"daoFQPN\"                   string                         \"github.com/alexj212/test/dao\"\n   \"daoPackageName\"            string                         \"dao\"\n   \"delSql\"                    string                         \"DELETE FROM `invoices` where InvoiceId = ?\"\n   \"insertSql\"                 string                         \"INSERT INTO `invoices` ( CustomerId,  InvoiceDate,  BillingAddress,  BillingCity,  BillingState,  BillingCountry,  BillingPostalCode,  Total) values ( ?, ?, ?, ?, ?, ?, ?, ? )\"\n   \"modelFQPN\"                 string                         \"github.com/alexj212/test/model\"\n   \"modelPackageName\"          string                         \"model\"\n   \"module\"                    string                         \"github.com/alexj212/test\"\n   \"outDir\"                    string                         \".\"\n   \"selectMultiSql\"            string                         \"SELECT * FROM `invoices`\"\n   \"selectOneSql\"              string                         \"SELECT * FROM `invoices` WHERE InvoiceId = ?\"\n   \"serverHost\"                string                         \"127.0.0.1\"\n   \"serverListen\"              string                         \":8080\"\n   \"serverPort\"                int                            8080\n   \"serverScheme\"              string                         \"http\"\n   \"sqlConnStr\"                string                         \"./example/sample.db\"\n   \"sqlType\"                   string                         \"sqlite3\"\n   \"tableInfos\"                map[string]*dbmeta.ModelInfo   map[string]*dbmeta.ModelInfo{\"invoices\":(*dbmeta.ModelInfo)(0xc0001e94a0)}\n   \"updateSql\"                 string                         \"UPDATE `invoices` set CustomerId = ?, InvoiceDate = ?, BillingAddress = ?, BillingCity = ?, BillingState = ?, BillingCountry = ?, BillingPostalCode = ?, Total = ? WHERE InvoiceId = ?\"\n\n\n```\n\n### Struct naming\nThe ability exists to set a template that will be used for generating a struct name. By passing the flag `--model_naming={{.}}`\nThe struct will be named the table name. Various functions can be used in the template to modify the name such as\n\nYou can use the argument `--name_test=user` in conjunction with the `--model_naming` or `--file_name`, to view what the naming would be.\n\n| Function   | Table Name  | Output\n|---|---|---|\n|singular   |Users   | `User`  |\n|pluralize   |Users   | `Users`  |\n|title   |Users   | `Users`  |\n|toLower   |Users   | `users`  |\n|toUpper   |Users   | `USERS`  |\n|toLowerCamelCase   |Users   | `users`  |\n|toUpperCamelCase   |Users   | `Users`  |\n|toSnakeCase   |Users   | `users`  |\n\n\n\n\n### Struct naming Examples\nTable Name: registration_source\n\n| Model Naming Format  | Generated Struct Name\n|---|---|\n|`{{.}}`   | registration_source   |\n|`Struct{{.}}`   | Structregistration_source   |\n|`Struct{{ singular .}}`   | Structregistration_source   |\n|`Struct{{ toLowerCamelCase .}}`   | Structregistration_source   |\n|`Struct{{ toUpperCamelCase .}}`   | StructRegistration_source   |\n|`Struct{{ toSnakeCase .}}`   | Structregistration_source   |\n|`Struct{{ toLowerCamelCase .}}`   | Structtable_registration_source   |\n|`Struct{{ toUpperCamelCase .}}`   | StructTable_registration_source   |\n|`Struct{{ toSnakeCase .}}`   | Structtable_registration_source   |\n|`Struct{{ toSnakeCase ( replace . \"table_\" \"\") }}`   | Structregistration_source   |\n\n\n## Notes\n- MySql, Mssql, Postgres and Sqlite have a database metadata fetcher that will query the db, and update the auto increment, primary key and nullable info for the gorm annotation.\n- Tables that have a non-standard primary key (NON integer based or String) the table will be ignored.\n\n## DB Meta Data Loading\n| DB   | Type  | Nullable  | Primary Key  | Auto Increment  | Column Len | default Value| create ddl\n|---|---|---|---|---|---|---|---|\n|sqlite   |y   | y  | y  | y  | y | y| y\n|postgres   |y   | y  | y  | y  | y | y| n\n|mysql   |y   | y  | y  | y  | y | y| y\n|ms sql   |y   | y  | y  | y  | y | y| n\n\n## Version History\n- v0.9.27 (08/04/2020)\n    - Updated '--exec' mode to provide various functions for processing\n    - copy function updated to provide --include and --exclude patterns. Patterns are processed in order, an include preceeding an exclude will take precedence. Multiple include and excludes can be specified. Files ending with .table.tmpl will be processed for each table. Output filenames will be stored in the proper directory, with a name of the table with the suffix of the template extension. Files ending with .tmpl will be processed as a template and the filename will be the name of the template stripped with the .tmpl suffix. \n    - When processing templates, files generated with a .go extension will be formatted with the go fmt.\n- v0.9.26 (07/31/2020)\n    - Release scripting\n    - Added custom script functions to copy, mkdir, touch, pwd\n    - Fixed custom script exec example\n- v0.9.25 (07/26/2020)\n    - Adhere json-fmt flag for all JSON response so when camel or lower_camel is specified, fields name in GetAll variant and DDL info will also have the same name format\n    - Fix: Build information embedded through linker in Makefile is not consistent with the variable defined in main file.\n    - Added --scheme and --listen options. This allows compiled binary to be used behind reverse proxy.\n    - In addition, template for generating URL was fixed, i.e. when PORT is 80, then PORT is omitted from URL segment.\n- v0.9.24 (07/13/2020)\n    - Fixed array bounds issue parsing mysql db meta\n- v0.9.23 (07/10/2020)\n    - Added postgres types: bigserial, serial, smallserial, bigserial, float4 to mapping.json\n- v0.9.22 (07/08/2020)\n    - Modified gogo.proto check to use GOPATH not hardcoded.\n    - Updated gen to error exit on first error encountered\n    - Added color output for error\n    - Added --no-color option for non colorized output\n- v0.9.21 (07/07/2020)\n    - Repacking templates, update version number in info.\n- v0.9.20 (07/07/2020)\n    - Fixed render error in router.go.tmpl\n    - upgraded project to use go.mod 1.14\n- v0.9.19 (07/07/2020)\n    - Added --windows flag to write files with CRLF windows line endings, otherwise they are all unix based LF line endings\n- v0.9.18 (06/30/2020)\n    - Fixed naming in templates away from hard coded model package.\n- v0.9.17 (06/30/2020)\n    - Refactored template loading, to better report error in template\n    - Added option to run gofmt on output directory\n- v0.9.16 (06/29/2020)\n    - Fixes to router.go.tmpl from calvinchengx\n    - Added postgres db support for inet and timestamptz\n- v0.9.15 (06/23/2020)\n    - Code cleanup using gofmt name suggestions.\n    - Template updates for generated code cleanup using gofmt name suggestions.\n- v0.9.14 (06/23/2020)\n    - Added model comment on field line if available from database.\n    - Added exposing TableInfo via api call.\n- v0.9.13 (06/22/2020)\n    - fixed closing of connections via defer\n    - bug fixes in sqlx generated code\n- v0.9.12 (06/14/2020)\n    - SQLX changed MustExec to Exec and checking/returning error\n    - Updated field renaming if duplicated, need more elegant renaming solution.\n    - Added exclude to test.sh\n- v0.9.11 (06/13/2020)\n    - Added ability to pass field, model and file naming format\n    - updated test scripts\n    - Fixed sqlx sql query placeholders\n- v0.9.10 (06/11/2020)\n    - Bug fix with retrieving varchar length from mysql\n    - Added support for mysql unsigned decimal - maps to float\n- v0.9.9 (06/11/2020)\n    - Fixed issue with mysql and table named `order`\n    - Fixed internals in GetAll generation in gorm and sqlx.\n- v0.9.8 (06/10/2020)\n    - Added ability to set file naming convention for models, dao, apis and grpc  `--file_naming={{.}}`\n    - Added ability to set struct naming convention `--model_naming={{.}}`\n    - Fixed bug with Makefile generation removing quoted conn string in `make regen`\n- v0.9.7 (06/09/2020)\n    - Added grpc server generation - WIP (looking for code improvements)\n    - Added ability to exclude tables\n    - Added support for unsigned from mysql ddl.\n- v0.9.6 (06/08/2020)\n    - Updated SQLX codegen\n    - Updated templates to split code gen functions into seperate files\n    - Added code_dao_gorm, code_dao_sqlx to be generated from templates\n- v0.9.5 (05/16/2020)\n    - Added SQLX codegen by default, split dao templates.\n    - Renamed templates\n- v0.9.4 (05/15/2020)\n    - Documentation updates, samples etc.\n- v0.9.3 (05/14/2020)\n    - Template bug fixes, when using custom api, dao and model package.\n    - Set primary key if not set to the first column\n    - Skip code gen if primary key column is not int or string\n    - validated codegen for mysql, mssql, postgres and sqlite3\n    - Fixed file naming if table ends with _test.go renames to _tst.go\n    - Fix for duplicate field names in struct due to renaming\n    - Added Notes for columns and tables for situations where a primary key is set since not defined in db\n    - Fixed issue when model contained field that had were named the same as funcs within model.\n- v0.9.2 (05/12/2020)\n    - Code cleanup gofmt, etc.\n- v0.9.1 (05/12/2020)\n- v0.9 (05/12/2020)\n    - updated db meta data loading fetching default values\n    - added default value to GORM tags\n    - Added protobuf .proto generation\n    - Added test app to display meta data\n    - Cleanup DDL generation\n    - Added support for varchar2, datetime2, float8, USER_DEFINED\n- v0.5\n\n\n\n## Contributors\n- [alexj212](https://github.com/alexj212) -  a big thanks to alexj212 for his contributions\n\nSee more contributors: [contributors](https://github.com/smallnest/gen/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallnest%2Fgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallnest%2Fgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallnest%2Fgen/lists"}