Commit graph

894 commits

Author SHA1 Message Date
Sergey Kurt
54f960659b Ignore columns with defaults in randomize 2017-03-15 15:37:04 +03:00
Sergey Kurt
6fad1bd148 Added column flag for autogenerated values like IDENTITY | TIMESTAMP | ROWVERSION 2017-03-15 15:31:09 +03:00
Sergey Kurt
705befef07 Fixed types mapping 2017-03-15 14:12:21 +03:00
Sergey Kurt
85fc6e546a Fixed float and real mapping 2017-03-14 18:49:40 +03:00
Sergey Kurt
6aadf439c9 Fixed column types mapping 2017-03-14 18:45:41 +03:00
Sergey Kurt
51e9961f0a Fixed OUTPUT values on Insert 2017-03-14 18:06:33 +03:00
Sergey Kurt
5d72569635 Fixed Insert and Select for timestamp, rowversion 2017-03-14 18:06:12 +03:00
Sergey Kurt
813fd43e03 Ignore columns with defaults on Insert 2017-03-14 17:41:45 +03:00
Sergey Kurt
a48e5f7f82 MS SQL compatible query for RETURNING clause 2017-03-14 16:52:54 +03:00
Sergey Kurt
e2e619dfb2 Check for error on tables schema file opening 2017-03-14 16:51:56 +03:00
Sergey Kurt
0bdbee86f1 Queries refactoring 2017-03-14 14:58:32 +03:00
Sergey Kurt
4f02886c2b Added space in SELECT TOP clause 2017-03-14 14:31:52 +03:00
Sergey Kurt
b783311248 Hack for MS SQL limit/offset query without ORDER BY clause 2017-03-14 14:24:03 +03:00
Sergey Kurt
e3254c1851 Allow MS SQL driver to use indexed placeholders 2017-03-14 14:01:53 +03:00
Sergey Kurt
aa01f21b5c Pass UseTopClause flag into the Dialect object 2017-03-14 13:59:05 +03:00
Sergey Kurt
ed6dad7eed MS SQL compatible query for checks if the row exists 2017-03-14 13:53:35 +03:00
Sergey Kurt
83d90f3f28 Fixed quote symbols order 2017-03-14 13:48:38 +03:00
Sergey Kurt
454a3a816a Fixed quote symbols 2017-03-14 13:46:35 +03:00
Sergey Kurt
b3c4580efa Fixed comment for SchemaTable 2017-03-14 12:45:50 +03:00
Sergey Kurt
cbdbe4891a MSSQL rows limit/offset via TOP or OFFSET ... FETCH NEXT ... ROWS 2017-03-14 11:13:56 +03:00
Sergey Kurt
e2f32e746e Main MSSQL test template 2017-03-13 19:11:34 +03:00
Sergey Kurt
b4c9af72e7 Correct quote symbols 2017-03-13 16:28:23 +03:00
Sergey Kurt
2d3983b992 Bit and tinyint data types support 2017-03-13 16:27:16 +03:00
Sergey Kurt
54af37ef9a SchemaTable with MSSQL support 2017-03-13 16:25:12 +03:00
Sergey Kurt
132339026a Regular expression for FK destroyer 2017-03-13 16:24:08 +03:00
Sergey Kurt
e00ea60679 Initial MSSQL support 2017-03-13 12:55:26 +03:00
Patrick O'brien
e8723a2797 Fix modulus fix 2017-03-04 20:15:05 +10:00
Patrick O'brien
60a40eaf48 Fix randomize vals wrapping around to ngative vals
* Use modulus to ensure values are within valid ranges
2017-03-04 12:27:09 +10:00
Aaron L
9067237f32 Bump Version 2017-03-01 18:31:16 -08:00
Aaron L
8f96ba35d6 Allow insertion of only-defaulted tables
- Tables that are only comprised of default values and have nothing
  passed into them on insertion will no longer generate syntax errors.
2017-03-01 18:18:47 -08:00
Aaron L
a5cb765403 Ensure created_at isn't updated when unnecessary
- When we build the update whitelist (when the user doesn't provide one)
  we simply say that the whitelist is all columns except pkeys. The
  reason we do this is because sqlboiler doesn't support dirty tracking
  and if you want to update just a few fields, it's easier to just
  explicitly pass a whitelist when you update. However, in the case of
  created_at - it's a field that's usually managed by us and so we
  should not be updating it unless a user explicitly requests it via the
  whitelist. So if the whitelist is empty we prune that column now if it
  exists from the auto-created whitelist.
- The user also reported that upsert has the same fate, but the logic is
  somewhat different there. It expects that there's a value for
  created_at or it assumes that one needs to be created. There's no
  more magic we can do around this one unfortunately. Upsert is a
  mythical beast that doesn't play as nicely with our model, so users
  will just have to be more careful.
- Fix #106
2017-02-24 22:52:09 -08:00
Aaron L
8aa4e2148c Use _ to avoid reserved words in func args
- Fix #107
2017-02-24 22:27:05 -08:00
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