Commit graph

143 commits

Author SHA1 Message Date
Patrick O'brien
d56e28a36d Fix Location pointer 2016-09-01 11:24:39 +10:00
Patrick O'brien
8f6191c4d2 Move buildUpsertQuery to boil 2016-09-01 11:20:16 +10:00
Patrick O'brien
e33da59f0b Update hook names 2016-09-01 11:12:46 +10:00
Aaron L
32b5952c96 Make sure we pass around the addr of slices.
- Use reflect.Indirect instead of .Elem()
2016-08-29 22:49:02 -07:00
Aaron L
f2b8f39d47 Initial nested eager load. 2016-08-29 22:49:02 -07:00
Patrick O'brien
d735c3df36 Add For query mod 2016-08-30 13:13:00 +10:00
Patrick O'brien
7f24185544 Add executor to hooks 2016-08-29 23:23:42 +10:00
Aaron L
9553f462c7 Merge branch 'sets' 2016-08-28 23:29:47 -07:00
Patrick O'brien
96d40fcfe4 Add automatic timestamps for created_at/updated_at
* Update and Insert
* Add --no-auto-timestamps flag
2016-08-29 00:12:37 +10:00
Patrick O'brien
e2553705e1 Remove BeforeSelect hook (makes no sense) 2016-08-28 21:23:08 +10:00
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
Aaron L
f489e22ab4 Rename Loaded -> R 2016-08-26 21:40:29 -07: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