Commit graph

132 commits

Author SHA1 Message Date
Patrick O'brien
2a5630ce3e Add before/after select/delete to hooks generation
* Add tests for all hooks
2016-08-28 21:13:45 +10:00
Patrick O'brien
8aad8fc479 Rename before/after Create hook to Insert hook 2016-08-28 20:54:46 +10:00
Patrick O'brien
09cdb7a652 Fix SQL (takes exec now)
* Add SQLG
* Update templates using SQL
2016-08-28 14:51:03 +10:00
Patrick O'brien
26bb719563 Remove bad things (sum, min, max, avg, etc) 2016-08-26 22:08:27 +10:00
Patrick O'brien
2179570afd Speed up getBoilTag 2016-08-26 12:26:58 +10:00
Aaron L
28e485603a Add fast path for binding by caching TitleCase 2016-08-23 23:20:41 -07:00
Aaron L
d130354890 Fix eager loading, off-by-one pointer 2016-08-23 22:07:51 -07:00
Aaron L
509fe44f4e Rename Relationships struct to Loaded 2016-08-22 21:54:02 -07:00
Aaron L
0975aca899 Fix some documentation. 2016-08-22 20:14:46 -07:00
Patrick O'brien
d40058c3ce Fix output of randomizer 2016-08-19 19:56:27 +10:00
Patrick O'brien
d28b3f4b62 Finish WHERE IN feature
* Fix bug with appendOr/And ordering
2016-08-19 03:21:53 +10:00
Patrick O'brien
3cdfc6237a Added parallel to some missing tests 2016-08-18 22:29:14 +10:00
Aaron L
f86d8d7ee9 Refactor randomize 2016-08-18 00:03:14 -07:00
Aaron L
f23092d4a5 Move randomize things 2016-08-17 23:57:46 -07:00
Aaron L
9c2a4d7852 Merge branch 'eager' 2016-08-17 23:17:13 -07:00
Patrick O'brien
3ae0b8a0d6 Fix randomize struct not ignoring boil - tag 2016-08-18 14:21:08 +10:00
Aaron L
3ecb8f96c0 Fix the loadRelationships code & test 2016-08-17 18:52:42 -07:00
Patrick O'brien
8806e76d9f Nearly finished relationship bind helper
* If only reflection would be nice
2016-08-18 03:56:00 +10:00
Patrick O'brien
94d36d7bf7 Begin IN implementation 2016-08-17 15:19:23 +10:00
Aaron L
7ce4146854 Add GetSliceValues to help clean up eager loads 2016-08-16 22:14:07 -07:00
Aaron L
80c08ce20a Make Bind act on a sql.Rows
- This change was important to be able to call boil.Bind() from other
  contexts than a query. We don't use query mods everywhere, and we
  shouldn't. This allows us to use the bind independent of that.
2016-08-16 22:14:07 -07:00
Patrick O'brien
9d6de3ba68 Remove test file for query mods 2016-08-16 22:41:43 +10:00
Patrick O'brien
a54725f0fc Add more tests
* Fix broken readme link
2016-08-16 01:46:41 +10:00
Patrick O'brien
aaa567c7df Add panic condition 2016-08-15 22:43:10 +10:00
Patrick O'brien
7be2f9f2bc Add RandomizeStruct test 2016-08-15 15:00:26 +10:00
Aaron L
6e18bbd5f1 Remove random from generation 2016-08-14 21:13:24 -07:00
Aaron L
1caa8afa73 Change seed to start at a random value.
- Insert at least some randomness.
2016-08-14 20:44:59 -07:00
Aaron L
490cdef5bc Force local seeds for randomize struct.
- Global data is actually a bad idea
2016-08-14 20:12:01 -07:00
Aaron L
81433cfaf4 Not freeing rows objects. 2016-08-14 18:36:22 -07:00
Patrick O'brien
75e28d3f5b Refactor RandomizeField
* Fix randomize arg in relationship helper
* Fix param name for RandomizeStruct
2016-08-15 01:32:57 +10:00
Aaron L
6a040bc11c Fix wording of testing 2016-08-14 03:07:23 -07:00
Aaron L
ff981ee885 Make counters atomic 2016-08-14 02:31:51 -07:00
Aaron L
8188648a11 Delete randomize slice 2016-08-14 02:11:32 -07:00
Aaron L
b34a8e3212 Destruct ugly code bits from boil package 2016-08-14 00:25:30 -07:00
Aaron L
efa1fbb80a Big refactor of generated code
- Stop generating helper functions for each model
- Move Insert/Update/Upsert query generation helpers to strmangle
- Add tests for query generation helpers
- Delete a lot of the Insert/Upsert tests that test the query generation
  helpers.
- Use tx for more of the tests.
2016-08-13 21:21:26 -07:00
Aaron L
ab88d8511d Move string set operations to strmangle
- Delete MakeDBName (unused)
- Rename HasElement to SetInclude
2016-08-13 16:34:02 -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
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
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
d2862ef281 Fix broken tests due to spacing 2016-08-13 22:34:46 +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
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