SQLBoiler is a tool to generate a Go ORM tailored to your database schema.
Find a file
2016-08-16 14:07:15 +10:00
bdb Add tests for keys.go 2016-08-16 00:38:26 +10:00
boil Add more tests 2016-08-16 01:46:41 +10:00
strmangle Uppercase any non-words (words w/o vowels aeiouy) 2016-08-15 19:51:00 +10:00
templates Change entire project tests. 2016-08-14 01:58:36 -07:00
templates_test Break up test suite further to avoid dead locks 2016-08-16 14:07:15 +10:00
testdata Add circle file and test schema 2016-08-05 15:20:31 +10:00
.gitignore Add .cover to gitignore 2016-08-14 01:00:23 +10:00
circle.yml Fix circle to use go1.7 2016-08-16 13:22:50 +10:00
config.go Add postgres sslmode to configuration. 2016-07-11 15:17:49 -07:00
fakedb_test.go Properly abstract LastInsertID 2016-08-13 16:34:02 -07:00
imports.go Convert all tests to go 1.7 Run format 2016-08-15 19:36:38 +10:00
imports_test.go Use errors package all over the project 2016-08-13 11:37:16 -07:00
LICENSE Update LICENSE to BSD 2016-08-15 22:43:42 +10:00
main.go Add config missing error 2016-08-15 23:15:05 +10:00
output.go Use errors package all over the project 2016-08-13 11:37:16 -07:00
output_test.go Move main back to root folder. 2016-06-12 11:19:23 -07:00
README.md Update readme, remove parallel from rel tests 2016-08-16 01:48:37 +10:00
sqlboiler.go Remove tables flag from binary 2016-08-15 22:42:40 +10:00
sqlboiler_test.go Properly abstract LastInsertID 2016-08-13 16:34:02 -07:00
templates.go Remove unused code from templates 2016-08-14 00:43:30 -07:00
templates_test.go Stop dividing templates up, and execute by name 2016-07-16 23:55:15 -07:00
text_helpers.go Update repo to add vattle org paths 2016-08-09 17:59:30 +10:00
text_helpers_test.go Properly abstract LastInsertID 2016-08-13 16:34:02 -07:00

SQLBoiler

License GoDoc CircleCI Go Report Card

SQLBoiler is a tool to generate a Go ORM tailored to your database schema.

Config

Before you use SQLBoiler make sure you create a sqlboiler.toml configuration file containing your database details.

The configuration file loader checks the working directory, $HOME/sqlboiler/.config directory and $XDG_CONFIG_HOME/sqlboiler directory to locate your configuration file. The working directory takes precedence.

sqlboiler.toml example file:

[postgres]
  host="localhost"
  port=5432
  user="dbusername"
  pass="dbpassword"
  dbname="dbname"
  sslmode="require"

The following config fields are optional, and default to:

postgres.port=5432
postgres.sslmode="require"

To disable SSLMode, use sslmode="disable".

How

SQLBoiler connects to your database (defined in your sqlboiler.toml file) to ascertain the structure of your tables, and builds your Go ORM code using the templates defined in the /templates and /templates_test folders.

Running SQLBoiler without the --table flag will result in SQLBoiler building boilerplate code for every table in your database the public schema. Tables created in Postgres will default to the public schema.

Usage:
  sqlboiler [flags] <driver>

Examples:
sqlboiler postgres

Flags:
  -o, --output string    The name of the folder to output to (default "models")
  -p, --pkgname string   The name you wish to assign to your generated package (default "models")