Commit Graph

282 Commits

Author SHA1 Message Date
Simon Binder fe8611c5f4
Avoid unecessary async in lambda 2023-01-27 16:30:05 +01:00
Simon Binder b048ce44d4
Avoid writing suffix twice (#2281) 2023-01-27 16:15:44 +01:00
Simon Binder ef0cada32e
Merge queries with `LIST` columns 2023-01-23 21:46:51 +01:00
Simon Binder 2c63c1a64e
Update docs for Dart components in SQL
Scopes components are enabled by default, so the warning is no longer
necessary.
2023-01-22 22:53:45 +01:00
Simon Binder 53c14cd1aa
Modular: Fix extends for data classes (#2263) 2023-01-11 11:29:44 +01:00
Simon Binder c3cd2f2eeb
Fix `DataClassName` annotation with extending 2023-01-10 17:38:25 +01:00
Simon Binder 6b4a186b15
Fix extending classes in modular mode (#2260) 2023-01-10 12:26:14 +01:00
Simon Binder bbb19d59bb
Ignore abstract tables (#1955) 2023-01-08 15:54:16 +01:00
Simon Binder a6bede2aaa
Generate type converters for views 2023-01-06 17:16:18 +01:00
Simon Binder 1d7e656e30
Support cast to enum types 2023-01-06 16:53:04 +01:00
Simon Binder bc325dd31c
Support cast to drift-specific types 2023-01-06 15:10:03 +01:00
Simon Binder 20e6b0d5fe
Fix crash, support type converters in views 2023-01-06 14:27:15 +01:00
Simon Binder 259e4cfdd3
Remove unused import 2023-01-05 23:13:45 +01:00
Simon Binder e562cb9d21
Support type converters in queries 2023-01-05 23:04:36 +01:00
Simon Binder e52836694c
Fix view data class names for schema files 2023-01-02 23:22:50 +01:00
Simon Binder 9734aa56d1
Ignore existing row types on views for schema code 2023-01-02 23:02:14 +01:00
Simon Binder 4cd7616f24
Strip drift data class name from `CREATE VIEW` 2023-01-02 20:04:22 +01:00
Alexander Wilde 624c145cfd companions flag shouldn't depend on data classes flag 2023-01-01 20:17:40 +00:00
Simon Binder ebc1ba6899
Add test 2022-12-31 14:11:58 +01:00
Simon Binder d02deca36b
Fix tests 2022-12-27 21:08:41 +01:00
Simon Binder a463ee14cb
Support existing row classes in the generator 2022-12-27 18:14:02 +01:00
Simon Binder f13fb4e218
Analyze existing row types for queries 2022-12-27 17:04:38 +01:00
Simon Binder 1cbc02267d
Store existing analyzer type for tables and views 2022-12-27 12:49:24 +01:00
Simon Binder 649af15333
Analysis support for existing query row types 2022-12-27 00:15:47 +01:00
Simon Binder 44cae65170
Order all result columns syntactically 2022-12-26 22:45:35 +01:00
Simon Binder 20aff8a9db
Begin with existing types for queries 2022-12-26 19:17:17 +01:00
Simon Binder 338dd1316e
Support records as existing row types 2022-12-26 00:23:04 +01:00
Simon Binder c4fc5b8ada
Fix running post-process builder in test 2022-12-25 19:29:33 +01:00
Simon Binder 7b639f837a
Generate helper Dart file to serialize types 2022-12-25 19:10:48 +01:00
Simon Binder 22a3d3965c
Allow `autoIncrement` on `int64` columns (#2223) 2022-12-20 18:52:08 +01:00
Simon Binder 344d5611c6
Merge pull request #2220 from North101/develop
Validate enum default value in drift files
2022-12-20 00:11:47 +01:00
Simon Binder 1497d719b5
Extend check to all literal uses 2022-12-19 23:55:13 +01:00
Simon Binder e2265eb597
Add `DriftAny` type to wrap `ANY` in strit tables 2022-12-18 18:55:17 +01:00
Simon Binder b520568984
Ignore internal tables when reading schema from db 2022-12-18 15:26:40 +01:00
Simon Binder 0e395bbef3
Fix `JSON KEY` not working 2022-12-17 21:36:24 +01:00
Simon Binder 425878b712
Fix tests around custom constraints 2022-12-16 16:03:34 +01:00
Simon Binder 657b68ab76
Extract custom Dart table constraints into schema 2022-12-16 15:34:07 +01:00
Simon Binder 5f8b1e3358
Recognize database files when dumping schema data 2022-12-15 16:47:44 +01:00
Simon Binder 597d84db26
Fix import expectation 2022-12-13 22:04:35 +01:00
Simon Binder 00dbc2f886
Avoid nested codes, add tests 2022-12-13 21:53:17 +01:00
Simon Binder ec2b564611
Fox crash when serializing simple queries 2022-12-12 22:18:10 +01:00
Simon Binder b6cff50135
Parse custom constraints applied to columns 2022-12-11 00:06:45 +01:00
Simon Binder 6659d78ca7
Oops, fix compilation errors 2022-12-07 11:05:22 +01:00
Simon Binder dafa07a88a
Don't further analyze part files (#2185) 2022-12-05 17:59:51 +01:00
Simon Binder d60c775435
Merge pull request #2181 from ValentinVignal/column-name-case
Add the `column_name_case` option
2022-12-03 14:13:16 +01:00
Simon Binder d366cff9ee
Write utils for function stubs 2022-12-03 14:05:58 +01:00
ValentinVignal 5b7a9f487a
Update the tests 2022-12-03 16:16:25 +08:00
ValentinVignal 496635afb5
🚚 Rename column_name_case into case_from_dart_to_sql 2022-12-03 15:55:58 +08:00
ValentinVignal b08088ab1b
Merge remote-tracking branch 'upstream/develop' into column-name-case 2022-12-03 14:56:51 +08:00
Simon Binder 1a51dbf4d6
Static analysis support for custom functions 2022-12-02 23:34:42 +01:00
ValentinVignal d719b9598a
Test on column_name_case option 2022-12-01 23:26:51 +08:00
Alexander Wilde c80e6b6cbe Fix tests 2022-12-01 04:43:27 +00:00
Simon Binder 6503624ff1
Merge pull request #2168 from ValentinVignal/textEnum
Add `textEnum` column builder and `EnumNameConverter`
2022-11-30 22:07:54 +01:00
Simon Binder 061d9b2008
Use indirect import for test 2022-11-30 21:29:44 +01:00
ValentinVignal 3cfa69c9d9
:sparkles Add ENUMNAME type 2022-12-01 00:40:13 +08:00
ValentinVignal 0c35d30dcb
💡 Better test description 2022-12-01 00:00:54 +08:00
ValentinVignal 89aec378af
Merge remote-tracking branch 'upstream/develop' into textEnum 2022-11-30 23:55:25 +08:00
ValentinVignal b9892ece5c
Verify the EnumNameConverter is used 2022-11-30 23:55:04 +08:00
Simon Binder 267821804e
Add generator unit test for #2178 2022-11-30 16:26:22 +01:00
ValentinVignal 197a3862e7
Merge remote-tracking branch 'upstream/develop' into textEnum
# Conflicts:
#	drift_dev/CHANGELOG.md
#	drift_dev/pubspec.yaml
2022-11-30 22:47:58 +08:00
Simon Binder 0ee8a6a7f9
Fix code generation for triggers and indices 2022-11-29 10:39:45 +01:00
ValentinVignal 4030db4c5f
🎨 Better type comparison and matcher 2022-11-28 18:54:56 +08:00
ValentinVignal 432b68cf4e
Update the tests 2022-11-26 21:51:27 +08:00
Simon Binder 59d347adbe
Fix spellfix1 module with new analyzer 2022-11-22 20:06:17 +01:00
Simon Binder 72a85b799c
Fix tests with new generator 2022-11-19 16:24:07 +01:00
Simon Binder 6512dc1cfc
Merge remote-tracking branch 'origin/develop' into modular-generation 2022-11-18 16:56:55 +01:00
Simon Binder e1ec5faa93
Fix analysis warnings in new analyzer 2022-11-18 12:19:03 +01:00
Simon Binder 564b4c887f
Migrate remaining tests 2022-11-18 12:02:38 +01:00
Simon Binder ec311aea57
Migrate remaining analyzer tests 2022-11-18 10:46:00 +01:00
Simon Binder 873cc9a7a9
Migrate service tests to new analyzer 2022-11-13 17:41:09 +01:00
Simon Binder ce0dffb362
Migrate entity reference sorter test 2022-11-11 18:17:16 +01:00
Simon Binder c69d1a6628
Delete old analyzer and model 2022-11-11 18:02:30 +01:00
Simon Binder e63f089b46
Fix drift_dev test 2022-11-07 16:06:09 +01:00
Abitofevrything 658bd5d646 Update test case 2022-11-05 20:35:02 +01:00
Simon Binder fe3566429f
Migrate more analyzer tests 2022-10-30 19:41:59 +01:00
Simon Binder 23b0c8a362
Migrate drift file analysis tests to new analyzer 2022-10-30 16:09:38 +01:00
Simon Binder 292dd9946d
Port more tests over to new analyzer 2022-10-29 17:30:18 +02:00
Simon Binder 49470e8361
Support serializing fts5 tablesi n new analyzer 2022-10-29 14:39:28 +02:00
Simon Binder e3a29ebbe2
Migrate some tests to new analyzer 2022-10-26 23:09:05 +02:00
Simon Binder b16d8f5e3a
Fix generated view code 2022-10-13 19:25:54 +02:00
Simon Binder 3dddbaf467
Merge branch 'develop' into modular-generation 2022-10-10 23:45:48 +02:00
Simon Binder 3d969c787f
Infer generated columns for drift 2022-10-10 23:18:10 +02:00
Simon Binder 0b68d68b6c
New analyzer: Support Dart views 2022-10-10 00:07:00 +02:00
Roman Laptev b2796fc77e
[drift_dev] Update analyzer and deprecated methods (#2084) 2022-09-27 21:30:12 +02:00
Simon Binder 8c1a62ae1b
Serialize and read uniqueKeys from schema (#2069) 2022-09-22 17:47:06 +02:00
Simon Binder dcdbcb7156
Simple test for new query analyzer 2022-09-18 21:52:36 +02:00
Simon Binder 5947956109
Start generating code from new analysis results 2022-09-17 23:14:52 +02:00
Simon Binder 090a0053f1
Merge branch 'develop' into modular-generation 2022-09-16 20:03:17 +02:00
Simon Binder 2bd7596de6
New analyzer: Basic query support 2022-09-12 22:56:33 +02:00
Daniel Brauner 025bb7c44b
Generated functions for returning queries return Iterable<_> instead of List<_> (#2044)
* fix for missing toList

* removed unnecessary toList
2022-09-12 19:05:45 +02:00
Simon Binder eabf2a1e03
Fix Dart reference analysis in new analyzer 2022-09-10 17:56:25 +02:00
Simon Binder 0f97b42a43
Analyze Dart tables with new analyzer 2022-09-10 16:34:17 +02:00
Simon Binder e20d43c07c
Add test for dart file discovery 2022-09-05 23:31:01 +02:00
Simon Binder c814cfd935
Prepare new test backend for Dart analysis 2022-09-05 13:51:41 +02:00
Simon Binder 61e568104a
Discover dart tables in new analyzer 2022-09-03 23:29:18 +02:00
Simon Binder 9eb15149d7
Serialize drift analysis results 2022-09-01 23:10:54 +02:00
Simon Binder 5637afe35a
Handle simple references in new table analyzer 2022-09-01 20:41:32 +02:00
Simon Binder 009056dc37
Handle equality and hashes for blobs 2022-09-01 18:11:41 +02:00
Simon Binder 13e7fd2b0b
Begin with table analysis in the new analyzer 2022-08-31 23:15:11 +02:00
Simon Binder 0adb398ddc
Merge branch 'develop' into modular-generation 2022-08-31 22:06:21 +02:00
Simon Binder ee66465d47
Avoid leading underscores for local identifiers 2022-08-31 00:59:19 +02:00
Simon Binder 0242ce56ac
Start resolving drift tables in new analyzer 2022-08-30 23:58:36 +02:00
Simon Binder aae09c02b0
Simple tests for pre-analysis step 2022-08-30 22:50:07 +02:00
Simon Binder 2575f36e82
Merge branch 'develop' into modular-generation 2022-08-30 21:20:32 +02:00
Simon Binder b87e5cae0c
Drift-specific analysis for fts5 tables 2022-08-25 18:50:24 +02:00
Simon Binder b088537b81
Preprocess step for new analysis runner 2022-08-20 22:54:46 +02:00
Simon Binder 27ea49137d
Properly read options (#1992) 2022-08-16 16:05:08 +02:00
Simon Binder a21576e02c
Move schema validation test to drift_dev 2022-08-15 21:16:58 +02:00
Simon Binder a89cef5262
Delete old moor packages 2022-08-14 22:57:37 +02:00
Simon Binder 8f6878292a
Migrate to `package:lints` 2022-08-13 23:33:05 +02:00
Simon Binder 83c7c1ab43
Remove deprecated options, re-run build 2022-08-13 15:14:09 +02:00
Simon Binder b9a605ed25
Allow async mappings from SQL to row classes
When existing, custom row classes are used, drift now supports using a
(potentially asynchronous) static method to load them instead of just
a named constructor like before.
Tables are also changed to support the `map` method being async for
cases where that is needed. The same applies to custom queries which
may have to be async now.
2022-08-12 22:55:02 +02:00
Simon Binder 50a65b236a
Upgrade to latest analyzer 2022-08-06 22:11:44 +02:00
Simon Binder 8cc85de5f7
Improve error message for schema difference 2022-08-06 21:35:05 +02:00
Simon Binder 0cb3527680
Schema tool: Store whether dates are text 2022-07-26 19:18:17 +02:00
Simon Binder d79c7e07ba
Lints for probable text datetime misuses 2022-07-25 20:58:39 +02:00
Simon Binder 6c0e27b24c
SQL analysis for text datetimes 2022-07-24 19:19:18 +02:00
Simon Binder 867f8cbfed
Remove drift_dev's ColumnType 2022-07-21 21:12:55 +02:00
Simon Binder 3744fa0601
Merge branch 'develop' into refactor-type-system 2022-07-20 22:37:34 +02:00
Simon Binder 9325af9c0e
Fix another test in drift_dev 2022-07-19 23:23:43 +02:00
ValentinVignal 9bd2486c85 Add a test to make sure data classes and companion classes are using a const constructor 2022-07-19 23:21:05 +08:00
ValentinVignal aab2b38f21 ✏️ Fix typo 2022-07-19 09:54:10 +08:00
Simon Binder 1af6bb78d9
Start removing the SqlTypeSystem class 2022-07-12 17:04:01 +02:00
Simon Binder 388b31e9ea
Remove some moor references in drift_dev 2022-07-03 22:20:24 +02:00
Simon Binder 116f98269d
Always enable the new SQL generation mode 2022-07-03 21:53:17 +02:00
Simon Binder 6049d1aaa0
Add test for #1902 2022-07-01 22:56:25 +02:00
Simon Binder 52c07c9d3f
Remove support for non-nnbd code 2022-07-01 21:51:14 +02:00
Simon Binder bfad77788e
Handle nullable converters for compiled queries 2022-06-28 22:34:11 +02:00
Simon Binder 8a68527fee
Merge remote-tracking branch 'North101/develop' into develop 2022-06-23 21:01:07 +02:00
Simon Binder cf1e94d384
Automatically make some converters nullable 2022-06-23 20:56:56 +02:00
Alexander Wilde 345faa91c7 TypeConverter mapToDart -> fromSql, mapToSql -> toSql 2022-06-22 23:50:19 +01:00
Simon Binder 06af930941
Explicit null-aware types on type converters 2022-06-22 23:56:15 +02:00
Simon Binder 7be4e90569
Exclude internal tables from schema verification 2022-06-10 11:02:52 +02:00
Simon Binder df0f4c5e06
Adapt error message in expectation 2022-05-25 17:02:35 +02:00
westito 2cfd2b41a3 Fix test (Dart 2.17) 2022-05-12 22:02:58 +02:00
Simon Binder 5e3de2fb7c
Remove lint around binary expr types 2022-05-10 20:46:30 +02:00
Simon Binder 80c8c86031
Support drift-defined views schema tools (#1813) 2022-04-23 23:31:04 +02:00
Simon Binder d0694f9d65
Consistently format goldens in writer test 2022-04-23 20:09:54 +02:00
Simon Binder 8479602023
Pick valid Dart names for views (#1814) 2022-04-23 16:06:11 +02:00
Simon Binder 5f6beb76ca
Support json type converters (#1811) 2022-04-22 23:38:41 +02:00
Daniel Brauner 3c75fbee9d New test cases 2022-04-06 22:07:28 +02:00
Simon Binder 62a95f6bd4
Write Dart refences into schema files 2022-04-04 22:32:07 +02:00
Simon Binder a721e896d3
Add warnings for `customConstraint` misuse 2022-04-04 21:13:07 +02:00
Simon Binder 6047ec912f
Add changelog entry, expand docs a bit 2022-04-03 12:34:21 +02:00
Simon Binder 4e508b62ab
Test parsing unique keys 2022-04-03 12:28:12 +02:00
westito c584b5ccfd Fix failed analyze and test codes 2022-04-02 20:12:57 +02:00
Simon Binder 5a2b6a36cc
Fix crash when reading type converters (#1757) 2022-03-15 16:51:30 +01:00
Simon Binder a60a795c66
Auto-migrate usages of `moor_flutter` 2022-03-14 21:04:04 +01:00
Simon Binder da212944ff
Replace old website and repository links 2022-03-13 15:52:15 +01:00
Simon Binder b25921a362
Write column getter into schema file (#1739) 2022-03-09 23:02:52 +01:00