SQLBoiler is a tool to generate a Go ORM tailored to your database schema.
Find a file
2016-08-23 13:39:10 +10:00
bdb Update mock and tests to use better tables 2016-08-23 13:39:10 +10:00
boil Fix some documentation. 2016-08-22 20:14:46 -07:00
strmangle Fix one more problem. 2016-08-21 23:00:22 -07:00
templates Fix some formatting bugs of generated code 2016-08-21 16:28:47 +10:00
templates_test Fix bugs for table only containing composite pkey 2016-08-21 15:44:49 +10:00
testdata Fix name conflict bug in find 2016-08-21 16:03:51 +10:00
.gitignore Add .cover to gitignore 2016-08-14 01:00:23 +10:00
circle.yml Fix circle path yet again 2016-08-16 17:56:45 +10:00
config.go Convert sqlboiler tests to MockDriver 2016-08-18 22:11:49 +10:00
imports.go Use new randomize package 2016-08-18 00:06:28 -07:00
imports_test.go Added parallel to some missing tests 2016-08-18 22:29:14 +10:00
LICENSE Update LICENSE to BSD 2016-08-15 22:43:42 +10:00
main.go Add cobra help for command failures 2016-08-17 00:22:41 +10:00
output.go Rename some files to keep sanity 2016-08-17 23:48:37 -07:00
output_test.go Added parallel to some missing tests 2016-08-18 22:29:14 +10:00
README.md Update readme, remove parallel from rel tests 2016-08-16 01:48:37 +10:00
sqlboiler.go Convert sqlboiler tests to MockDriver 2016-08-18 22:11:49 +10:00
sqlboiler_test.go Convert sqlboiler tests to MockDriver 2016-08-18 22:11:49 +10:00
templates.go Support many_to_many eager loading properly 2016-08-17 23:09:54 -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 Update mock and tests to use better tables 2016-08-23 13:39:10 +10: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")