From 6903b4756e45226b915c21d6fd0a85e20f5001db Mon Sep 17 00:00:00 2001 From: Patrick O Date: Sat, 17 Sep 2016 14:12:37 +1000 Subject: [PATCH] Fix path i nreadme, add boil.SetDB --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 739c1f0..67c9004 100644 --- a/README.md +++ b/README.md @@ -91,12 +91,12 @@ Table of Contents - Relationships/Associations - Eager loading (recursive) - Custom struct tags -- Schema support - Transactions - Raw SQL fallback - Compatibility tests (Run against your own DB schema) - Debug logging -- Postgres 1d arrays, json, hstore & more +- Schemas support +- 1d arrays, json, hstore & more ### Supported Databases @@ -112,7 +112,7 @@ For a comprehensive list of available operations and examples please see [Featur ```go import ( // Import this so we don't have to use qm.Limit etc. - . "github.com/vattle/sqlboiler/boil/qm" + . "github.com/vattle/sqlboiler/queries/qm" ) // Open handle to database like normal @@ -121,6 +121,12 @@ if err != nil { return err } +// If you don't want to pass in db to all generated methods +// you can use boil.SetDB to set it globally, and then use +// the G variant methods like so: +boil.SetDB(db) +users, err := models.UsersG().All() + // Query all users users, err := models.Users(db).All()