2016-02-24 20:45:09 +10:00
# SQLBoiler
2016-02-23 18:27:32 +10:00
2016-08-09 17:59:30 +10:00
[![License ](https://img.shields.io/badge/license-MIT-blue.svg )](https://github.com/vattle/sqlboiler/blob/master/LICENSE.md)
2016-02-25 10:16:02 +10:00
[![GoDoc ](https://godoc.org/github.com/pobri19/sqlboiler?status.svg )](https://godoc.org/github.com/pobri19/sqlboiler)
2016-08-09 17:59:30 +10:00
[![CircleCI ](https://circleci.com/gh/vattle/sqlboiler.svg?style=shield )](https://circleci.com/gh/vattle/sqlboiler)
[![Go Report Card ](https://goreportcard.com/badge/kubernetes/helm )](http://goreportcard.com/report/vattle/sqlboiler)
2016-02-25 10:16:02 +10:00
2016-04-26 21:31:00 +10:00
SQLBoiler is a tool to generate a Go ORM tailored to your database schema.
2016-02-24 20:45:09 +10:00
2016-07-11 15:43:59 +10:00
#### Config
2016-02-25 10:20:39 +10:00
2016-07-11 15:42:37 +10:00
config.toml
2016-02-25 10:20:39 +10:00
````
[postgres]
host="localhost"
port=5432
user="dbusername"
pass="dbpassword"
dbname="dbname"
````
2016-07-11 15:43:59 +10:00
#### How
2016-02-24 20:45:09 +10:00
2016-04-26 21:31:00 +10:00
SQLBoiler connects to your database (defined in your config.toml file) to ascertain the structure of your tables, and builds your Go ORM code using the templates defined in the ````/templates` ``` folder.
2016-02-24 20:45:09 +10:00
Running SQLBoiler without the ````--table` ``` flag will result in SQLBoiler building boilerplate code for every table in your database marked as ` ```public` ```.
2016-02-25 10:20:39 +10:00
Before you use SQLBoiler make sure you create a ````config.toml` ``` configuration file with your database details, and specify your database by using the ` ```--driver` ``` flag.
2016-02-24 20:45:09 +10:00
````
2016-04-26 21:31:00 +10:00
Usage:
sqlboiler [flags]
2016-02-24 20:45:09 +10:00
Flags:
2016-04-26 21:31:00 +10:00
-d, --driver string The name of the driver in your config.toml (mandatory)
-f, --folder string The name of the output folder (default "output")
-p, --pkgname string The name you wish to assign to your generated package (default "model")
-t, --table string A comma seperated list of table names (generates all tables if not provided)
2016-02-24 20:45:09 +10:00
````