Commit Graph

581 Commits

Author SHA1 Message Date
Simon Binder 602212f99d
Support REQUIRED annotation for query vars 2021-04-13 22:14:12 +02:00
Simon Binder 51d5ada5c9
Fix moor files importing the original Dart source 2021-04-12 12:01:43 +02:00
Simon Binder 1e962312ca
Improve UX when importing part files (#1136) 2021-04-11 19:56:13 +02:00
Simon Binder 8d625cc13b
Initial documentation for custom row classes 2021-04-10 13:01:24 +02:00
Pavel e1f3242850 option to make all named parameters required 2021-04-10 01:19:26 +03:00
Simon Binder 6bbff77271
Rename to @CustomRowClass 2021-04-09 23:33:58 +02:00
Simon Binder 6682c1f909
Initial support for custom data classes 2021-04-09 22:59:41 +02:00
Simon Binder 133b7c652f
Fix generation for placeholders before arrays 2021-04-03 22:23:37 +02:00
Simon Binder eb39738460
Initial support for RETURNING in the generator 2021-03-30 23:24:28 +02:00
Simon Binder ab0c2c5e55
Release moor and moor_generator version 4.2.1 2021-03-24 10:02:53 +01:00
Simon Binder 401b4d3650
Fix reading nullable columns 2021-03-23 16:59:11 +01:00
Simon Binder f76044989e
Adopt minimum SDK version, fix docs on mobile 2021-03-19 20:35:08 +01:00
Simon Binder c1aafa0b9d
Support latest source_gen and dart_style 2021-03-19 16:47:01 +01:00
Simon Binder ddbb3a2d67
Warn when using RETURNING for now 2021-03-18 16:35:51 +01:00
Simon Binder bdf7d22776
Bump versions of moor, moor_generator and sqlparser 2021-03-18 16:25:00 +01:00
Simon Binder 613c7944c8
Generator option for target sqlite version 2021-03-16 21:45:21 +01:00
Simon Binder f677aac4d5
Migrate a few more file in moor_generator 2021-03-16 09:52:35 +01:00
Simon Binder c32ccac756
Upgrade to build 2.0 2021-03-16 09:47:09 +01:00
Simon Binder 7c911713de
Two more analysis errors around RETURNING 2021-03-13 22:25:39 +01:00
Simon Binder cf9ea89681
moor_generator: Support the math extension 2021-03-13 14:56:06 +01:00
Simon Binder 1b6c031aaa
Migrate migrations example to null-safety 2021-03-09 21:52:46 +01:00
Simon Binder f943576f5d
Migrate schema verification apis to null-safety 2021-03-09 21:37:39 +01:00
Simon Binder 8c7679568c
generator: Migration option parsing to null-safety 2021-03-09 21:33:54 +01:00
Simon Binder 65472a9e7d
Per-file nnbd opt-out in moor_generator 2021-03-09 21:27:25 +01:00
Simon Binder d279f1cdff
Support analyzer 1.x in moor_generator 2021-03-07 13:35:27 +01:00
Simon Binder dbc4bcffaa
Fix view generation and references 2021-03-01 11:54:46 +01:00
Simon Binder c7e7683ede
Publish moor, moor_generator 4.1.0, sqlparser 0.14.0 2021-02-21 13:12:15 +01:00
Simon Binder 9bb2a24abf
Prepare 4.1 release 2021-02-20 22:03:34 +01:00
Simon Binder 535425e34f
Document confusing code 2021-02-14 16:50:21 +01:00
Simon Binder 61d5b7897a
Upgrade dependencies where possible 2021-02-14 14:06:51 +01:00
Simon Binder c0865e51fb
Avoid analyzing unfinished views 2021-02-11 22:03:25 +01:00
Hossein Yousefi c0fc691a94 view analyzer class added 2021-02-11 18:38:41 +01:00
Hossein Yousefi bf813cf67b added a test that fails 2021-02-10 22:47:39 +01:00
Hossein Yousefi c9269e13be added support for CREATE VIEW in .moor files 2021-02-10 16:23:51 +01:00
Simon Binder ca2be1bb6a
Add Dart default value to generated schema (#1018) 2021-01-27 22:10:34 +01:00
Simon Binder 821a1009cf
Also format generated SQL for schema entities 2021-01-26 14:33:33 +01:00
Simon Binder 76e6d2d219
Fix whitespace handling in new SQL generator 2021-01-24 12:27:53 +01:00
Simon Binder 4ba12c4868
Strip whitespace and comments from generated queries 2021-01-23 21:03:03 +01:00
Simon Binder 5ff74c7bcb
Improve table analysis, parse key ordering (#1007) 2021-01-18 14:44:05 +01:00
Peter Leibiger d54936df91
Only add nullable suffix on converter types when NNBD is active 2021-01-15 11:32:53 +01:00
Simon Binder 4575287ba4
Avoid InconsistentAnalysisException in preprocess builder 2021-01-14 23:23:34 +01:00
Simon Binder 43f90b6a43
Improve error messages when the preparing builder fails 2021-01-14 19:33:00 +01:00
Simon Binder f5996cb957
Upgrade dependencies of moor_generator 2021-01-14 19:15:32 +01:00
Simon Binder c5cbd1b62e
Release moor 4 preview to pub 2021-01-11 20:15:10 +01:00
Simon Binder b8eed2f75b
Make order by placeholders optional (#998) 2021-01-08 22:30:17 +01:00
Simon Binder db72da0f07
Use new build apis to load results (#959) 2020-12-29 22:22:32 +01:00
Simon Binder 22c38aa911
Support newer versions of cli_util 2020-12-21 13:21:24 +01:00
Simon Binder 1655bcc69f
Recognize withoutRowId in Dart tables (#972) 2020-12-17 19:49:08 +01:00
Simon Binder 6aa022e547
Add nullability hints, generate nullable variables 2020-12-14 18:35:19 +01:00
Simon Binder 5db10342b0
Fix nnbd generation around type converters (#968) 2020-12-14 15:13:59 +01:00
Simon Binder 0dddd33c45
Add test for daos with invalid types (#967) 2020-12-12 20:34:01 +01:00
Simon Binder fea1692a6e
Support latest analyzer, use regular plugin package 2020-12-12 20:00:54 +01:00
Simon Binder 5eda201749
Remove legacy type inference 2020-12-12 19:55:43 +01:00
Simon Binder 5401a4c80a
Publish dev packages to simonbinder.eu 2020-12-10 15:19:02 +01:00
Simon Binder 42ba773422
Consequently upgrade dev version to 4.0.0 2020-12-07 21:30:15 +01:00
Simon Binder 47b8989318
More analyzer workarounds (#959) 2020-12-07 21:18:27 +01:00
Simon Binder 35d2d1fca8
Merge branch 'develop' into nnbd
# Conflicts:
#	moor/test/data/tables/custom_tables.g.dart
2020-12-04 20:01:22 +01:00
Simon Binder 0259fd58fd
Support older versions of the convert package too 2020-11-26 16:59:06 +01:00
Simon Binder 0c075a2b44
Support overriding column getters and table classes (#932) 2020-11-23 20:01:31 +01:00
Simon Binder 9e60acfe18
Fix new errors from GitHub actions 2020-11-20 18:25:53 +01:00
Simon Binder 01258d25ab
Fix nnbd code emitted by the generator 2020-11-19 14:06:51 +01:00
Simon Binder b2ef4ddbcf
Optionally generate named parameters (#918) 2020-11-16 17:03:22 +01:00
Simon Binder 6c913a4811
Support raw statements in migration tests (#909) 2020-11-14 12:26:01 +01:00
Simon Binder d44699f0ee
Start writing some unit tests for schema verification 2020-11-13 18:06:42 +01:00
Simon Binder 708033c88c
Fix verifier migrating to the latest version 2020-11-12 21:41:45 +01:00
Simon Binder c7669a18a0
Fix more bugs in schema verification tests 2020-11-11 11:36:19 +01:00
Simon Binder 95dacd986c
Generate dontWriteConstraints for schema tests 2020-11-09 18:55:15 +01:00
Gustav Bylund 4eba4e7070 feat: add support for documentation comments 2020-10-28 00:43:56 +01:00
Simon Binder 71e5c4941e
Support comparing types with different names 2020-10-23 19:22:30 +02:00
Simon Binder 1c3ab61895
Generate nullable types for converters (#892) 2020-10-23 14:58:24 +02:00
Simon Binder e29fcf93f7
Publish moor 3.4, sqlparser 0.11 2020-10-22 14:17:54 +02:00
Simon Binder ce37d15d2a
Generate nnbd code for inputs that have opted in 2020-10-17 14:31:04 +02:00
Simon Binder b0b3445574
Migrate query elements to new type interface 2020-10-17 13:18:59 +02:00
Simon Binder 4f79140cc8
Use published analyzer_plugin_fork 2020-10-17 13:04:32 +02:00
Simon Binder e4d985728a
Migrate to analyzer version 0.40 2020-10-16 19:25:10 +02:00
Simon Binder 7e88e74a6c
Add tests for schema verification, fix inconsistencies 2020-10-16 17:16:45 +02:00
Simon Binder 10620cf738
Start writing docs for schema migrations 2020-10-14 22:01:36 +02:00
Simon Binder cf537721cb
Add tools to generate old versions of a database 2020-10-14 21:15:17 +02:00
Simon Binder 3470d0485a
Add current_time_millis SQL function (#857) 2020-10-11 11:25:21 +02:00
Simon Binder d6a321ca3c
Add generate_values_in_copy_with build option (#795) 2020-09-01 13:34:02 +02:00
Simon Binder e510be34a3
Warn when using default values outside of expressions 2020-08-30 14:05:28 +02:00
Simon Binder 2ae2388878
Support default values for Dart placeholders (#753) 2020-08-30 13:48:47 +02:00
Simon Binder 527b9d731d
Plugin: Send request error for non-moor requests (#779) 2020-08-22 19:07:51 +02:00
Simon Binder 02cd8f2b33
Add more analyzer tags to generator tests 2020-08-21 17:37:07 +02:00
Simon Binder 6fba2555c1
Api to turn AST nodes into a textual represenation 2020-08-21 16:44:17 +02:00
Simon Binder a037de6621
Support rowid resolution outside of selects
This fixes #754
2020-08-10 10:46:33 +02:00
Simon Binder 5cbc331dda
Release moor, moor_generator 3.3.1, sqlparser 0.10.1 2020-08-07 21:58:56 +02:00
Simon Binder cd61c5ad16
Generator: Fix duplicate code generation for table imports (#447) 2020-08-06 16:49:58 +02:00
Simon Binder 5510cb97b1
Release version 3.3.0 and moor_ffi 0.8.0 2020-07-29 13:00:50 +02:00
Simon Binder 3215b7e571
Prepare 3.3.0 release 2020-07-28 22:30:04 +02:00
Simon Binder c2ce934361
Apply type converters on variables (#730) 2020-07-23 17:30:26 +02:00
Simon Binder a01f5be2ac
Don't attempt to analyze null moor files 2020-07-22 10:34:22 +02:00
Simon Binder 6b43a57911
Warn when using both primaryKey and autoIncrement() 2020-07-21 19:43:43 +02:00
Simon Binder 834ca520b1
Lint for mismatching types in arithmetic expressions 2020-07-18 11:19:20 +02:00
Simon Binder ba60bb9962
Don't generate const constructors for mutable classes (#699) 2020-07-17 13:12:06 +02:00
Simon Binder 6922ae0409
Guard against invalid sessions in the type deserializer 2020-07-14 19:10:22 +02:00
Simon Binder bf464c751a
Remove usage of newly deprecated analyzer apis 2020-07-13 21:49:21 +02:00
Simon Binder 7ce9ee3b0c
Fix remaining InconsistentAnalysisExceptions 2020-07-13 15:28:18 +02:00
Simon Binder e21163d90a
Deprecate the eagerly_load_dart_ast option 2020-07-09 17:49:05 +02:00
Simon Binder fa1e76f8f3
Option to get raw data in result sets (#615) 2020-07-09 17:38:46 +02:00
Simon Binder 7ff91a620a
Some improvements related to generator error recovery 2020-07-07 23:01:02 +02:00
Simon Binder 2332c58742
Override toString in result classes (#676) 2020-07-02 19:59:41 +02:00
Simon Binder c80235799c
moor_generator: Properly release analyzer during tests 2020-06-28 18:48:32 +02:00
Simon Binder 3923b815fd
Merge branch 'master' into develop
# Conflicts:
#	moor_generator/pubspec.yaml
2020-06-28 17:34:00 +02:00
Simon Binder 3a558c3d1d
Prepare moor 3.2, moor_ffi 0.7 release 2020-06-28 17:27:32 +02:00
Simon Binder ab4b1d75ff
Escape keywords in moor_generator tests 2020-06-27 13:06:29 +02:00
Simon Binder 1e8a1de6c0
sqlparser: Add visit methods for Queryable subclasses 2020-06-16 14:25:31 +02:00
Simon Binder d089edd4c9
Migrate back to analyzer_plugin package (#623) 2020-06-11 18:05:23 +02:00
Simon Binder ee6e09699e
Error when using autoIncrement and primaryKey override 2020-06-04 20:50:43 +02:00
Simon Binder 835e31c8ed
Add `this.` prefix to avoid name clashes (#613) 2020-06-03 19:07:53 +02:00
Simon Binder f6ab5f64a8
Option to generate mutable data classes (#551) 2020-06-02 22:26:59 +02:00
Simon Binder 9f651b3ce9
Better support for changing analysis sessions 2020-06-02 11:48:16 +02:00
Till Friebe 1bab7f11d2 Add toString to companions
This is very useful for unit tests, because we can see directly what
values a companion has.
2020-05-28 18:52:32 +02:00
Simon Binder 074c9d973d
Don't crash when daos can't be read (#601) 2020-05-28 11:17:03 +02:00
Simon Binder 01e5a47189
Make utility visitor methods an extension 2020-05-24 19:53:36 +02:00
Simon Binder 9be0a9f79c
Fix result sets generating twice 2020-05-22 20:32:47 +02:00
Peter Leibiger 1da495a745
Fix generator required minimum analyzer version
`languageVersionMajor/Minor` was added in analyzer version 0.39.5 and is used since 4d463dd145
2020-05-22 18:10:29 +02:00
Simon Binder b8335b1222
Mention custom result class names in changelog 2020-05-22 17:25:30 +02:00
Simon Binder 8a98b42e62
Optimize row mapping when there is a matching table 2020-05-21 20:21:03 +02:00
Simon Binder 513881b13f
Always use a lambda for select mapping 2020-05-21 19:37:54 +02:00
Simon Binder 6c18eb22fa
Initial tests for custom result classes 2020-05-21 18:59:03 +02:00
Simon Binder 5d93f9fcf9
Analysis support for custom result sets 2020-05-21 15:22:49 +02:00
Simon Binder cbf8191e5d
Fix table sorting for tables referencing themselves (#586) 2020-05-20 13:41:40 +02:00
Simon Binder b5cc9b974d
Release update to pub 2020-05-18 22:07:19 +02:00
Simon Binder ba7fedb4c4
Fix generator tests that were failing due to a stronger assert 2020-05-17 20:26:21 +02:00
Simon Binder f8a516b51a
Use emitsThrough instead of emits 2020-05-17 15:08:24 +02:00
Simon Binder 63e0d61ccb
Fix resolving urls in common backend 2020-05-17 15:00:14 +02:00
Simon Binder 9bb83605e9
Don't crash when analyzing incomplete CREATE TABLE statement (#578) 2020-05-17 14:42:48 +02:00
Simon Binder 4d463dd145
Emit a warning if a project's language version is too low (#577) 2020-05-17 14:20:18 +02:00
Simon Binder cf830165e1
Support enum converters for moor files, add documentation 2020-05-13 21:43:58 +02:00
Simon Binder 7b9fa3d9ed
Simplify generation of enum type converters 2020-05-13 20:16:20 +02:00
Simon Binder 0f2ff8c97a
Implicitly create type converters for enums, Dart api (#478) 2020-05-12 21:47:11 +02:00
Simon Binder 04f24d3184
Ignore broken offset calculation for autocomplete 2020-05-12 13:38:28 +02:00
Simon Binder 254a54e9b6
Fix crash in analyzer plugin 2020-05-09 16:55:54 +02:00
Simon Binder 44bd89e47a
Don't throw when resolving types outside of the build analyzer
We still can't resolve the actual type, but at least we don't crash
now.
As we don't read the type of converters in the plugin or CLI, this
fixes #550
2020-05-08 21:43:36 +02:00
Simon Binder 0af49dd6df
Bring back the toCompanion method for data classes (#257) 2020-05-08 20:53:58 +02:00
Simon Binder c8935b0518
Respect foreign key constraints for stream query propagation (#528) 2020-05-06 22:55:38 +02:00
Simon Binder 8b6abd7140
Move referenced table finder to sqlparser package (#537) 2020-05-04 22:00:41 +02:00
Simon Binder 0a30b8a12e
Upgrade integration tests, release sqlparser 0.8 2020-05-03 13:28:34 +02:00
Simon Binder d3c4eac166
First release preparation for moor 3.0 2020-05-02 14:50:04 +02:00
Simon Binder 84bac1bf1d
Initial support for sql expressions in companions 2020-04-17 20:48:22 +02:00
Simon Binder 62a363105a
Refactor Insertables to avoid covariant parameters 2020-04-17 18:02:05 +02:00
Simon Binder 9a78604d98
Fix issues with new inference, enable it by default 2020-04-16 19:07:30 +02:00
Simon Binder 72e65611a7
Respect transitive imports when resolving moor converters
Might fix an error discovered in #482
2020-04-09 22:28:40 +02:00
Simon Binder 402b2f0d45
Merge pull request #474 from North101/develop
Fix weird behaviour with nested results
2020-04-05 14:21:42 +02:00
Simon Binder e90607c6da
Fix reading primaryKeys for tables in moor repo 2020-04-05 14:17:25 +02:00
Alexander Wilde 6eeaa88f67 Fix weird behaviour with nested results 2020-04-05 13:15:34 +01:00
Simon Binder 8bddb7c2c5
Skip null columns in Dart parser (#471) 2020-04-05 13:50:44 +02:00
Simon Binder 2c511d3ad4
Reformat sql_query class, reword docs 2020-04-04 13:07:17 +02:00
Simon Binder edc9029ece
Test linter behavior on nested columns 2020-04-04 13:01:40 +02:00