Commit graph

26 commits

Author SHA1 Message Date
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
8a7a9a35e8 Fix the last bits of problems with auto inc pkey 2016-08-13 16:34:02 -07:00
Aaron L
944303f2f5 Properly abstract LastInsertID 2016-08-13 16:34:02 -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
Patrick O'brien
160c6ff0f0 Begin the pain 2016-08-13 16:34:02 -07:00
Patrick O'brien
641a433a2d Fix query in insert 2016-08-14 06:35:43 +10: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
6c299c82cb Fix formatting errors 2016-08-14 02:16:10 +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
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
Patrick O'brien
b9fc5e4080 Fix ReloadAll 0 value primary key collisions 2016-08-09 10:34:21 +10:00
Patrick O'brien
fa8e431349 Add ReloadAll for ObjectSlice
* Fix RandomizeSlice bug overwriting blacklisted columns
* Add GroupAt param to param flags generator
2016-08-08 23:30:29 +10:00
Patrick O'brien
a073752df2 Remove duplicates from insert whitelist 2016-08-08 16:59:54 +10:00
Patrick O'brien
ed2c5e407d Fix insert and update whitelist generators 2016-08-04 13:55:25 +10:00
Aaron L
b8b44eba98 Document generateInsertColumns properly. 2016-08-03 20:52:43 -07:00
Aaron L
4a90e726db Fixed up documentation. 2016-08-03 20:23:55 -07:00
Patrick O'brien
2d732c727a Remove X funcs and add G funcs 2016-08-01 15:10:10 +10:00
Patrick O'brien
f45d137f5f Added panic functions
* Fixed linter errors
* Added lots of missing comments
* Fixed broken boil tests
* Skipped unfinished functions instead of error
2016-07-16 21:22:57 +10:00
Patrick O'brien
c424780458 Refactored and finished insert tests 2016-07-14 15:09:05 +10:00
Patrick O'brien
4036786b6a Got insert testing in a better state
* Split up insert function for testing
* Add DBType to global state
* Move test reflection helpers to testing.go
* Add incremental seed to randomizeField to avoid duplicate constraint
  error messages
* Fixed Viper SSL default bug
* Fixed pgpass SSL inclusion bug
* Add MakeStringMap strmangle helper
* Change test errors from error to skip
2016-07-14 02:51:40 +10:00
Patrick O'brien
08d168605f Added more insert test, added comments
* Added IsZeroValue helper
2016-07-08 01:59:07 +10:00
Aaron L
c731661261 Use new templating features in all templates
- Add another check for join tables in the to_many relationships stuff.
- Fix a number of quoting bugs in the templates.
2016-06-26 23:59:27 -07:00
Aaron L
84a160f3a4 Start of the to_many relationships. 2016-06-22 22:03:05 -07:00
Renamed from templates/07_insert.tpl (Browse further)