Aaron L
1875bac7cf
Correct improper detection of one-to-one
2016-08-13 15:33:54 -07:00
Patrick O'brien
641a433a2d
Fix query in insert
2016-08-14 06:35:43 +10:00
Patrick O'brien
3fb6c1aa48
Convert Delete object to use Exec
2016-08-14 05:07:38 +10:00
Aaron L
2b4508b228
Pass through sql.ErrNoRows for .Find() too
2016-08-13 11:56:59 -07:00
Aaron L
956157d057
Pass through no-rows errors to the user for .One()
2016-08-13 11:42:28 -07:00
Aaron L
1ac3853d3c
Refactor some awkward looking bits
2016-08-13 11:39:03 -07:00
Aaron L
5360d3094e
Use errors package all over the project
...
In general:
errors.New("thing") -> errors.New
fmt.Errorf("thing %s", arg) -> errors.Errorf
fmt.Errorf("thing %v", err) -> errors.Wrap
fmt.Errorf("thing %s %v", arg, err) -> errors.Wrapf
2016-08-13 11:37:16 -07:00
Patrick O'brien
39eebe7a91
Fix broken u u i d
2016-08-14 04:26:11 +10:00
Patrick O'brien
f823dfc757
Fix broken exists test for UUID PRIMARY KEYS
2016-08-14 03:42:58 +10:00
Patrick O'brien
8831e8a4b9
Fix debug outputs for all templates
2016-08-14 02:58:18 +10:00
Patrick O'brien
7ae9af702f
Add debug output to Exists
2016-08-14 02:19:36 +10:00
Patrick O'brien
6c299c82cb
Fix formatting errors
2016-08-14 02:16:10 +10:00
Patrick O'brien
ae198fd759
Fix formatting
2016-08-14 02:07:28 +10:00
Patrick O'brien
f97ac44445
Add .cover to gitignore
2016-08-14 01:00:23 +10:00
Patrick O'brien
ffa751b1a7
Add escaping question marks for args
...
* Add thorough ConvertQuestionMarks test
2016-08-14 00:54:46 +10:00
Patrick O'brien
8ccfdc38df
Add BufPool to query_builders.go
2016-08-14 00:20:13 +10:00
Patrick O'brien
799c35125f
Move DriverUsesLastInsertID to correct package
2016-08-14 00:07:22 +10:00
Patrick O'brien
bd92e49ff0
BufPool WhereClause
2016-08-14 00:01:06 +10:00
Patrick O'brien
5922dc89bd
BufPool SetParamNames
2016-08-13 23:59:02 +10:00
Patrick O'brien
ce65125ade
BufPool Placeholders
2016-08-13 23:55:52 +10:00
Patrick O'brien
ab9e5c89bd
BufPool MakeStringMap
2016-08-13 23:54:57 +10:00
Patrick O'brien
d7e5bf1ef7
BufPool TitleCase and CamelCase
2016-08-13 23:48:31 +10:00
Patrick O'brien
ddb3aff125
BufPool Singular and Plural
2016-08-13 23:39:13 +10:00
Patrick O'brien
e4800f9af8
BufPool for Identifier
2016-08-13 23:30:53 +10:00
Patrick O'brien
d2862ef281
Fix broken tests due to spacing
2016-08-13 22:34:46 +10:00
Patrick O'brien
8d92b5a9dd
Add buf pool to IdentQuote
2016-08-13 18:07:45 +10:00
Patrick O'brien
19b4b722e7
Fix placeholder output
2016-08-13 17:57:13 +10:00
Patrick O'brien
dd71e0907a
Add byte buffer pool
2016-08-13 17:49:39 +10:00
Patrick O'brien
d92a439c54
Modify postgres query to get is_unique for indexes
...
* Remove unused SnakeCase function
* Fix formatting bug in relationship structs
2016-08-13 17:30:55 +10:00
Patrick O'brien
7517ad3ced
Fix ? conversion to $x for having and join args
2016-08-13 03:59:50 +10:00
Patrick O'brien
4b27cea3a6
Add join with where using args test
2016-08-13 03:28:46 +10:00
Patrick O'brien
4571184b7d
Add args to Having query mod
...
* Add more thorough golden tests
* Fix bug in update column ordering, now uses sort
2016-08-13 03:08:09 +10:00
Patrick O'brien
d1265764dc
Remove unecessary print
2016-08-11 22:38:55 +10:00
Patrick O'brien
18029166c0
Add FilterColumnsByUnique, finish UpdateAll slice
...
* Add FilterColumnsByUnique
* Fix lots of broken tests
* Made CompareVals less stupid
Note: UpdateAll tests still broken because Unique
is not being fetched correctly for INDEX types,
it is only working for UNIQUE constraints.
2016-08-11 22:26:49 +10:00
Patrick O'brien
e3f319346f
Finish UpdateAll query builder
...
* Add modifiers to delete builder
* Update golden file tests
* Add startAt to whereClause
2016-08-11 18:23:47 +10:00
Patrick O'brien
c3f8cff117
Add Or and And query mods, add ? placeholders
...
* Update whereClause builder to support Or and parentheses
* ? placeholders are now used instead of $1, $2 etc for where clauses.
* Update the whereClause test to add more tests and fix broken ones.
* Fix broken golden test files.
2016-08-11 16:44:15 +10:00
Patrick O'brien
af1b647fb4
Remove Or query mod, add builder whereClause test
...
* Add fixture tests/golden files
2016-08-09 22:29:59 +10:00
Patrick O'brien
99b292b1ee
Update query builder to make queries readable
...
* Finish DeleteAll for slice and query
* Fixed some formatting and comments
2016-08-09 20:19:42 +10:00
Patrick O'brien
3431919269
Fix broken whereclause test
2016-08-09 18:11:28 +10:00
Patrick O'brien
33286e648a
Update repo to add vattle org paths
2016-08-09 17:59:30 +10:00
Patrick O'brien
2ece7d14f6
Clean up helpers, remove duplicate funcs
...
* Refactor DeleteAll for slice
2016-08-09 15:57:54 +10:00
Aaron L
8e3c1d41da
GenerateParamFlags -> Placeholders
...
- Rewrite Placeholders to not use as much wizardry and magnetism
2016-08-08 20:19:26 -07:00
Aaron L
a98e474c9c
Refactor WhereMultiple into new WhereClause
2016-08-08 19:33:10 -07:00
Aaron L
db747cccfe
Fix fallout of whereclause change
2016-08-08 17:36:37 -07:00
Aaron L
b1d1b30724
Fix where clauses for templates
2016-08-08 17:36:37 -07:00
Aaron L
89ec1cfdb7
Delete useless duplicate method.
2016-08-08 17:36:37 -07:00
Aaron L
005218d61f
Add WhereMultiple
...
- Change the order of the args in WhereClause to support varargs
2016-08-08 17:36:37 -07:00
Aaron L
097de57e59
Add InClause
2016-08-08 17:36:37 -07:00
Aaron L
7c65598f17
Fix spacing problem.
2016-08-08 17:36:37 -07:00
Patrick O'brien
b9fc5e4080
Fix ReloadAll 0 value primary key collisions
2016-08-09 10:34:21 +10:00