Commit graph

962 commits

Author SHA1 Message Date
Patrick O'brien
3747754236 export importer members and add basepath for Stat 2017-02-05 21:41:30 +10:00
Patrick O'brien
e2c53aa312 Add imports library functionality 2017-02-05 20:17:11 +10:00
Patrick O'brien
dea061f571 Use Base and Stat instead of os.Seperator split
* Validates we're using filenames and ensures compatibility with all filesystems
2017-02-05 16:45:41 +10:00
Patrick O'brien
e70ed0d070 Bump version 2017-02-05 02:27:55 +10:00
Patrick O'brien
60814eed1f Fix replace feature 2017-02-05 02:24:20 +10:00
Patrick O'brien
acaf94ef5f Remove println that should not be present 2017-02-04 23:22:39 +10:00
Patrick O'brien
10ee452032 Hide replace flag from help output
* Replace flag is a "not recommended for use" flag, and is mainly
present to be used with software that is using sqlboiler as a library,
such as abcweb
2017-02-04 15:51:07 +10:00
Aaron L
59c238539d Attach all eagerly loaded models in to-one
- The problem here is that due to the nature of the relationship and the
  way the loop was set up it was possible to miss some relationships:

A _ C
 \_ D

B _ E
 \_ F

Since we looped over A and B and did a break when we found something to
attach it to (in this example A would find C) it would break. What we
should be looping through is CDEF and finding a home for each one.

Did the same change in to_one though it doesn't matter since it's
one-to-one.

to-many is untouched because it's already looping over CDEF and finding
a home for it because the relationship is reversed.

- Fix #98
2017-01-26 22:06:47 -08:00
Aaron L
0221da2491 Document: regeneration, extensions, --wipe flag
- As discussed in #96
2017-01-26 21:17:03 -08:00
Aaron L
671e1d7ae9 Add --wipe flag to rm the output dir pre-generate
- As discussed in #96
2017-01-26 20:53:34 -08:00
Aaron L
ec28cb4148 Add no-edit disclaimer to all generated files
- As discussed in #96
2017-01-26 20:41:30 -08:00
Aaron L
c02a2f0c20 Fix null dereference 2017-01-24 23:04:59 -08:00
Aaron L
d79f816cc1 Fix test failure
- Optimistic code removed. It wasn't possible to test for this condition
  ever.
2017-01-24 23:03:59 -08:00
Aaron L
936df65ebc Fix ToManyRemoveOp
- This would generate a bad query when run, also the test was failing
  for this same reason and once enabled it was trivial to fix.
2017-01-24 22:45:20 -08:00
Aaron L
bdb0ef1b7c Fix missing tests
- ToMany(Set|Remove)Op tests were not being generated for join tables.
2017-01-24 22:44:11 -08:00
Aaron L
c33bb479a1 Fix postgres placeholders for to-many.RemoveX
- Help fix #97
2017-01-24 18:57:45 -08:00
Patrick O'brien
e992e327c2 Fix inflection bug for "ss" words (like address)
* Adjust inflect rules
* Bump version to 2.1.8
2017-01-24 13:31:43 +10:00
Aaron L
761efee9f0 Add ability to replace a template
- This feature remains undocumented because it's not a good idea in most
  cases but it enables us to replace a template. This is especially
  useful when using sqlboiler as a library since testmain
  problematically loads config in it's own magical way, divorced from
  even the way sqlboiler in "normal" mode loads it. This enables
  replacement of that mechanism by replacing it's template.
2017-01-15 21:21:04 -08:00
Aaron L
bfba60eaad Bump version 2017-01-15 21:11:02 -08:00
Patrick O'brien
cb54ded207 add sqlboiler logo 2017-01-15 11:43:58 +10:00
Patrick O'brien
faf511a7e6 fix boilingcore package comment 2017-01-14 16:13:32 +10:00
Aaron L
4506da6b41 Change detection hack for broken arrays in viper
- Fix #91
2017-01-13 20:01:00 -08:00
Patrick O'brien
788d28400e rename core to boilingcore to make a more sense
* make more sense as a third party library
2017-01-14 13:38:40 +10:00
Patrick O'brien
88cde8df0c Made new core package to hold core of app
* This was primarily done so it can be used as a library in ABCWeb and
other apps.
2017-01-14 13:13:55 +10:00
Aaron L
ab01c9d234 Don't eat so many spaces in to_many templates
- Fix #89
2017-01-10 18:16:02 -08:00
Aaron L
aab85fd2cd Add issue template. 2017-01-10 18:09:20 -08:00
Aaron L
61ab7e254a Add missing function variants for setops.
- Fix #87
2017-01-09 21:06:47 -08:00
Aaron L
4997ba96bf Add more clear documentation about boil.Begin()
- Fix #88
2017-01-09 20:28:07 -08:00
Aaron L
711ecbbe8d Use pg-specific schema tables for fkey detection
- Postgres doesn't care about names for uniqueness of keys unlike mysql
  because internally it keeps "oid" values to keep track of everything.
  Unfortunately this means that the information_schema standard is
  inadequate to differentiate between constraints that are named the
  same (which isn't possible in mysql, but is in pg). Hence we have to
  dip into the pg specific schemas for better or worse.
- Fix naming of the sample schema in the README since it would fail for
  mysql due to duplicate naming.
- Mark test schema up so we don't fix the bad names so we catch
  regressions here.
- Fix #85
2017-01-06 17:53:10 -08:00
Patrick O'brien
fac1a7fe69 update schemas to incl broken example from readme 2017-01-07 01:17:28 +10:00
Patrick O'brien
be2131c763 Bump to 2.1.5
* Includes fix #77 #82 (to one associations erroneously generated)
* Includes readme update
2017-01-07 01:00:02 +10:00
Patrick O'brien
158d9cbec0 remove commas from schema example 2017-01-07 00:48:39 +10:00
Aaron L
22f7a45847 Ignore empty errors on postgres upsert fail
- Postgres's behavior when there is no update is that there is an
  ErrNoRows thrown back, which we can safely ignore since the only time
  this can happen in postgres's case is under this circumstance since
  there's no race unlike the mysql upsert code.
- Fix #84
2017-01-05 21:31:43 -08:00
Aaron L
4ae9336538 Fix bug in ToManySetOpsAdd and impure join tables
- This is a bug that manifests itself a bunch with our update code where
  you cannot actually use the update method to update a key since it
  uses the values on the struct to both update the values and find the
  object to update but in this operation the key must have two different
  values.
2017-01-04 20:31:29 -08:00
Aaron L
14b9122a08 Fix underspecification of constraint lookups. 2017-01-03 20:29:43 -08:00
Aaron L
5f7bee14a0 Relax the definition of unique on columns (psql)
- Fix formatting on giant postgres query
- Invert the section that looks for unique constraints to look for a
  constraint and join to the constraint_column_usage to be more in line
  with the mysql query and also it makes a little bit more sense.
- Add more checks to ensure the schema is being enforced in the postgres
  side of things as several pieces in the unique checks were missing it
  which would lead to false positives.
- Fix #77 for postgres
2017-01-03 19:43:01 -08:00
Aaron L
23b6221f8b Relax the definition of unique on columns (mysql)
- Fix #77
2017-01-03 19:11:15 -08:00
Patrick O'brien
dd73656d8e Fix readme example spacing 2017-01-02 15:21:16 +10:00
Patrick O'brien
920cb42f9b Add examples for top level config 2017-01-02 15:20:32 +10:00
Patrick O'brien
dea748d409 Add --tinyint-as-bool flag (v2.1.4 release) 2017-01-02 15:16:08 +10:00
Aaron L
5449ce7c6c Bump to 2.1.3 2016-12-27 23:31:24 -08:00
Patrick O'brien
94a6604d19 Fix missing string array import 2016-12-27 23:29:36 -08:00
Aaron L
874efb1cce Bump 2.1.1 2016-11-15 22:03:11 -08:00
Aaron L
b6b16b8dd6 Fix combining relationship query mods
- Fix #67
2016-11-15 21:57:21 -08:00
Aaron L
b7cd6f3f99 Add additional nil checks to the eager loading code
- Needed a couple nil checks in the eager loading code. The tests didn't
  (and now do) cover the case where an eager load function returns
  empty or nil things.
- Fix #66
2016-11-15 21:56:59 -08:00
Aaron L
a8330b18ad Fix a len(0) check that wasn't occurring 2016-11-15 20:34:36 -08:00
Aaron L
ac48562dc2 Bump version 2016-11-12 00:12:04 -08:00
Aaron L
ca748b070d Merge branch 'dev' 2016-11-12 00:08:09 -08:00
Aaron L
0cd1b61926 Add enums to readme
- Fix a number of indentation and trailing space issues
2016-11-11 23:59:21 -08:00
Chhatoi Pritam Baral
d2eccc98ad Fix reading basedir from config and cli flag 2016-11-11 23:34:56 -08:00