Commit Graph

687 Commits

Author SHA1 Message Date
ValentinVignal 4030db4c5f
🎨 Better type comparison and matcher 2022-11-28 18:54:56 +08:00
Simon Binder a837e51fda
Prepare pubspecs for new release 2022-11-27 17:05:16 +01:00
ValentinVignal 432b68cf4e
Update the tests 2022-11-26 21:51:27 +08:00
ValentinVignal e8ee29bb18
textEnum 2022-11-26 21:51:13 +08:00
Simon Binder 15edd501aa
Support generating database accessors in modular mode 2022-11-25 14:49:14 +01:00
Simon Binder 59d347adbe
Fix spellfix1 module with new analyzer 2022-11-22 20:06:17 +01:00
Simon Binder fde7adde48
Support triggers and indices in modular generation 2022-11-22 20:06:16 +01:00
Simon Binder f4e45584ec
Begin optional modular code generation 2022-11-20 17:28:27 +01:00
Simon Binder 72a85b799c
Fix tests with new generator 2022-11-19 16:24:07 +01:00
Simon Binder c77fc3612f
Run dart format in drift_dev 2022-11-18 17:01:21 +01:00
Simon Binder 6512dc1cfc
Merge remote-tracking branch 'origin/develop' into modular-generation 2022-11-18 16:56:55 +01:00
Simon Binder 596a35b58e
Document basic analysis concept 2022-11-18 16:33:19 +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 ea6a8a2217
Re-generate migration tests 2022-11-11 17:50:21 +01:00
Simon Binder 360ee348a2
Fix compilation errors in CLI 2022-11-09 21:59:45 +01:00
Simon Binder e63f089b46
Fix drift_dev test 2022-11-07 16:06:09 +01:00
Simon Binder d491db8599
Move dialect to SqlTypes constructor, re-generate 2022-11-07 15:53:16 +01:00
Abitofevrything 658bd5d646 Update test case 2022-11-05 20:35:02 +01:00
Abitofevrything cb1389f272 Extract generated code to method 2022-11-05 20:34:55 +01:00
Simon Binder 3b12faaa46
Start migrating schema files to new analyzer 2022-11-05 19:44:43 +01:00
Simon Binder c5a800d4c4
Migrate simple CLI tools to new analyzer 2022-11-05 18:32:13 +01:00
Simon Binder c5504237d5
Make drift's tests pass with new analyzer 2022-11-04 13:42:06 +01:00
Simon Binder c2b319bc8e
Fix writing type converters 2022-11-01 00:14:17 +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
Abitofevrything 2106b7010b Pass dialect to SqlTypes methods 2022-10-29 16:36:04 +02:00
Abitofevrything fbff2ceccd Use postgresql boolean type for bool columns 2022-10-29 15:48:45 +02:00
Simon Binder 49470e8361
Support serializing fts5 tablesi n new analyzer 2022-10-29 14:39:28 +02:00
Abitofevrything 52b885c007 Don't export customConstraints in schema file is constraints are empty 2022-10-29 14:22:22 +02:00
Abitofevrything 52d2d908c0 Don't generate empty constraints 2022-10-29 13:37:38 +02:00
Abitofevrything c8d63b845d Generate dialect-specific constraints 2022-10-29 13:16:21 +02:00
Simon Binder fdd1d2c66e
Fix deprecation warnings from analyzer upgrade 2022-10-29 12:17:07 +02:00
Simon Binder e3a29ebbe2
Migrate some tests to new analyzer 2022-10-26 23:09:05 +02:00
Simon Binder 69808525c0
Port over drift lints to new analyzer 2022-10-26 20:36:35 +02:00
Simon Binder 81679b8ff1
Fix formatting some Dart placeholders 2022-10-23 18:13:40 +02:00
Simon Binder f38d56842e
Fix nullability for drift -> sqlparser mapping 2022-10-23 17:46:57 +02:00
Simon Binder 9f48d49cb3
Read primary key in drift files 2022-10-23 17:36:28 +02:00
Simon Binder 75169c9d7e
Read type converters in drift files 2022-10-23 17:15:59 +02:00
Simon Binder 70a88cfe3a
Fix generating array types with new analyzers 2022-10-23 15:52:21 +02:00
Simon Binder e3b6c56f08
Fix syntax error in generated code for queries 2022-10-19 23:35:54 +02:00
Simon Binder 2ec63749f8
New analyzer: Better support for virtual tables 2022-10-18 22:28:53 +02:00
Simon Binder b16b5ad2c2
Merge branch 'develop' into modular-generation 2022-10-18 21:55:43 +02:00
Simon Binder 92bb5a7fa1
Add test and changelog 2022-10-18 20:36:09 +02:00
Alexander Wilde 09951adda6 JsonTypeConverterWithDifferentTypes -> JsonTypeConverter2 2022-10-18 01:06:22 +01:00
Alexander Wilde ff9d419559 Backwards compatible attempt 2022-10-16 00:44:58 +01:00
Alexander Wilde ba28b51125 Decouple JsonTypeConverter from TypeConverter 2022-10-14 19:56:28 +01:00
Simon Binder 81ba7686c7
Generate queries with new analyzer 2022-10-13 22:05:42 +02:00
Simon Binder b16d8f5e3a
Fix generated view code 2022-10-13 19:25:54 +02:00
Simon Binder 189af5d443
View generation wth new analyzer 2022-10-12 01:23:17 +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
Simon Binder 808f582b08
Release sqlparser and drift_dev 2022-10-06 22:56:25 +02:00
Simon Binder a2e10d9abc
Prepare 2.2.0 release 2022-10-06 13:27:25 +02:00
Simon Binder 470fb49592
Write companions with new analyzer 2022-10-03 17:37:10 +02:00
Simon Binder 1a39c5eb8d
Start emitting data class and table code 2022-10-03 15:04:22 +02:00
Simon Binder ef1b94af1d
Start generating code with new analyzer 2022-10-02 23:15:11 +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 28c90b6ffb
Always escape column names
This avoids the performance impact of using a regex in `escapeIfNeeded`.
Closes #2071.
2022-09-22 16:55:36 +02:00
Simon Binder dcdbcb7156
Simple test for new query analyzer 2022-09-18 21:52:36 +02:00
Simon Binder b33ef8a220
Analyze SQL queries 2022-09-18 21:25:46 +02:00
Simon Binder 5947956109
Start generating code from new analysis results 2022-09-17 23:14:52 +02:00
Simon Binder a6caae9d8f
Parse entrypoints in new analyzer 2022-09-17 00:16:53 +02:00
Simon Binder 090a0053f1
Merge branch 'develop' into modular-generation 2022-09-16 20:03:17 +02:00
Fabian Freund cd89379627
Static analysis support for spellfix1 (#2013) 2022-09-16 16:02:39 +02:00
Simon Binder 8e9e7fc291
Use melos to manage packages (#2060) 2022-09-15 23:42:20 +02:00
Simon Binder 24316c80a6
Remove unecessary schema_version assignment 2022-09-13 22:01:00 +02:00
Simon Binder 4da647e8a3
Ignore android_metadata table in schema comparison 2022-09-13 10:38:46 +02:00
Simon Binder 2bd7596de6
New analyzer: Basic query support 2022-09-12 22:56:33 +02:00
Simon Binder e08ccdbcda
New analyzer: Support analyzing drift views 2022-09-12 21:57:19 +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 ac52957848
Prepare analysis for views 2022-09-11 22:11:12 +02:00
Simon Binder 5508a9f246
Support triggers in new analyzer 2022-09-10 23:50:24 +02:00
Simon Binder aa5cb69799
Support indices in new analyzer 2022-09-10 23:22:39 +02:00
Simon Binder 97ed32f05a
Serialize column constraints 2022-09-10 18:18:39 +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 e88ec41555
More work on Dart table analysis in new analyzer 2022-09-10 01:05:09 +02:00
Simon Binder 1681c83bea
Fix null analysis for Dart views (#2031) 2022-09-08 23:06:00 +02:00
Simon Binder e20d43c07c
Add test for dart file discovery 2022-09-05 23:31:01 +02:00
Simon Binder eb7299c2d5
Stop mentioning `compact_query_methods` (#2036) 2022-09-05 13:54:47 +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 ce35a27069
Prepare 2.1.0 release 2022-08-29 22:27:35 +02:00
Konstantin Scheglov b399db78e3
Prepare for separating ClassElement, EnumElement, and MixinElement. (#2025)
* Prepare for separating ClassElement, EnumElement, and MixinElement.

* Improve error UX when casting to ClassElement

Co-authored-by: Simon Binder <oss@simonbinder.eu>
2022-08-29 20:44:09 +02:00
Simon Binder b87e5cae0c
Drift-specific analysis for fts5 tables 2022-08-25 18:50:24 +02:00
Fabian Freund d1e623a0c6 added rtree support 2022-08-23 16:33:23 +03:00
Simon Binder f82ea5936d
Draft for drift file discovery 2022-08-22 22:05:39 +02:00
Simon Binder 5e4a65eace
First draft for intermediate results 2022-08-21 23:45:42 +02:00
Simon Binder a12a2b8086
Prepare minor release 2022-08-21 13:47:00 +02:00
Simon Binder b088537b81
Preprocess step for new analysis runner 2022-08-20 22:54:46 +02:00
North101 a927d3717a
Typealiases and easier defaults for scoped components
Closes #1993.
2022-08-20 00:22:28 +02:00
Simon Binder 7bc0aecf4c
Initial draft of outline model 2022-08-19 22:20:28 +02:00
westito 5a49c9540b
Fix column writer nullability check (#1846) 2022-08-18 21:53:50 +02:00
Simon Binder d205ab9477
Fix typos in changelog 2022-08-18 17:36:36 +02:00
Simon Binder ea1c635da8
Stop generating unecessary null check 2022-08-16 17:36:29 +02:00
Simon Binder 788c95238e
Prepare release 2022-08-16 16:33:15 +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 7acb8407f0
Use pubspec_overrides for overrides 2022-08-14 17:21:22 +02:00
Simon Binder 5ece4c7ec0
Merge branch 'latest-release' into develop 2022-08-14 16:42:15 +02:00
Simon Binder 9011137c8e
Fix migration code for virtual tables (#1988) 2022-08-14 15:01:21 +02:00
Simon Binder 8f6878292a
Migrate to `package:lints` 2022-08-13 23:33:05 +02:00
Simon Binder 72fb1fa60c
Fix version constraint in drift_dev 2022-08-13 22:15:40 +02:00
Simon Binder 1035fe9d1d
Bump version numbers 2022-08-13 22:11:20 +02:00
Simon Binder 83c7c1ab43
Remove deprecated options, re-run build 2022-08-13 15:14:09 +02:00
Simon Binder a4fe582f25
Collect documentation for 2.0 release 2022-08-13 14:18:17 +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
Konstantin Shcheglov 23c8502c34 Require analyzer 4.5.0, stop using deprecated APIs. 2022-08-09 16:19:23 -07:00
Simon Binder 092a427a94
Prepare 1.7.1 drift_dev patch release 2022-08-09 23:17:59 +02:00
Simon Binder 2b5fdbc0b1
Upgrade to latest analyzer 2022-08-09 23:16:29 +02:00
Simon Binder 68df9c3197
Upgrade to new analysis plugin API 2022-08-09 22:46:30 +02:00
Simon Binder 1edeb4fe45
Merge pull request #1958 from simolus3/fix-toColumns-null-check
Remove null check when parameter is not nullable in dart
2022-08-08 22:25:19 +02:00
westito 40554c8166 Merge remote-tracking branch 'simolus3/develop' into fix-lint-warning 2022-08-08 11:30:57 +02:00
westito 5c05b4e375
Update drift_dev/lib/src/writer/database_writer.dart
Co-authored-by: Simon Binder <oss@simonbinder.eu>
2022-08-08 11:27:03 +02:00
westito 940ecd2ec4 Merge remote-tracking branch 'simolus3/develop' into fix-toColumns-null-check 2022-08-08 11:18:49 +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
westito 26333eafb5 Fix lint warnings when strict type check enabled 2022-08-01 12:15:42 +02:00
westito 4bb36488e1 Remove null check when parameter is not nullable in dart 2022-08-01 12:03:43 +02:00
Simon Binder c69b34278b
Fix overly long line 2022-07-29 19:05:42 +02:00
Simon Binder cf95ed6f05
Re-generate migration tests in app example 2022-07-29 18:54:41 +02:00
Simon Binder 0cb3527680
Schema tool: Store whether dates are text 2022-07-26 19:18:17 +02:00
Simon Binder 9158c31240
Respect db options in runtime schema validation 2022-07-26 18:33:09 +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 592e2cdd5d
Add build option for dates as text 2022-07-24 17:50:48 +02:00
Simon Binder efb4c5f503
Fix deprecation warning 2022-07-23 23:20:07 +02:00
Simon Binder 867f8cbfed
Remove drift_dev's ColumnType 2022-07-21 21:12:55 +02:00
Alexander Wilde e12021150e Fix generated fromJson for nullable columns with a JsonTypeConverters 2022-07-21 17:33:23 +01:00
Simon Binder 3744fa0601
Merge branch 'develop' into refactor-type-system 2022-07-20 22:37:34 +02:00
ValentinVignal 1b001e5fa0 🚚 Move gitignore to root 2022-07-20 09:14:14 +08:00
Simon Binder 9325af9c0e
Fix another test in drift_dev 2022-07-19 23:23:43 +02:00
Simon Binder a8c6031fc4
Add documentation comments, fix analysis warnings 2022-07-19 23:01:22 +02:00
Simon Binder 22d5f0a8ae
Fix tests 2022-07-19 22:55:08 +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 f440f1c91a :see_no_devil: gitignore build/ 2022-07-19 18:03:19 +08:00
ValentinVignal aab2b38f21 ✏️ Fix typo 2022-07-19 09:54:10 +08:00
ValentinVignal c380d16aa1 Use const constructor for immutable classes 2022-07-19 09:53:59 +08:00
Simon Binder cf8d2618fa
First attempt to get it running again 2022-07-18 23:28:12 +02:00
Simon Binder 8d840f3eb3
Remove includeJoinedTableColumns entirely 2022-07-16 12:07:12 +02: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
Alexander Wilde 5388a03fc6 Update innerColumnType comment 2022-06-29 12:18:40 +01:00
Alexander Wilde 6f6eaadf28 Fix non-null JsonTypeConverter 2022-06-29 11:27:27 +01:00
Simon Binder 1b06fcfc77
Merge branch 'develop' into fix-tests 2022-06-28 23:05:22 +02:00
Simon Binder bfad77788e
Handle nullable converters for compiled queries 2022-06-28 22:34:11 +02:00
westito 292da80167 Regenerate all files 2022-06-28 13:24:57 +02:00
Simon Binder 5317d0a33b
Upgrade to new analysis plugin API 2022-06-23 22:46:23 +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 52f95bb61d
Merge pull request #1888 from Mike278/bugfix/analyzer-4.1.0
Depend on analyzer 4.1.0 for 'isNotOptional' -> 'isRequired' deprecation
2022-06-14 23:02:57 +02:00
Mike278 561dda4379 Depend on analyzer 4.1.0 for 'isNotOptional' -> 'isRequired' deprecation 2022-06-14 15:57:58 -04:00
Simon Binder 7be4e90569
Exclude internal tables from schema verification 2022-06-10 11:02:52 +02:00
Simon Binder 9af708773c
Prepare 1.7.0 release 2022-06-07 14:39:45 +02:00
westito a816c1aac2 Fix typeconverter-depend nullability in DataClass copyWidth 2022-05-30 13:25:18 +02:00
Simon Binder e503bc68a5
New implementation for reference scopes 2022-05-25 23:32:15 +02:00
Simon Binder df0f4c5e06
Adapt error message in expectation 2022-05-25 17:02:35 +02:00
Simon Binder 117fb19db4
Improve error msg for old sqlite3 version 2022-05-25 15:43:53 +02:00
Simon Binder 49f3f64bcc
Fix view mapping generation (#1855) 2022-05-24 18:41:48 +02:00
Jishnu Mohan dc4e542f26
Support analyzer 4.x.x (#1841) 2022-05-18 12:39:46 +02:00
Simon Binder 6ff4ce976a
Avoid duplicate code in view definition 2022-05-17 21:55:20 +02:00
Simon Binder 4d3d794f15
Alias Dart view columns and tables 2022-05-17 21:47:10 +02:00
westito 2cfd2b41a3 Fix test (Dart 2.17) 2022-05-12 22:02:58 +02:00
westito ff4bc9be18 Fix drift_dev lint issue 2022-05-12 21:48:51 +02:00
westito 7330cf5d58 Add BigInt support to executors 2022-05-12 17:57:56 +02:00
westito 2b4bcc9864 Add BigInt support 2022-05-11 18:51:45 +02:00
Simon Binder 5e3de2fb7c
Remove lint around binary expr types 2022-05-10 20:46:30 +02:00
Simon Binder 184353a7aa
Release drift 1.6.0 2022-05-04 21:27:58 +02:00
North101 5bf9b2a3aa
Fix not null when using JsonTypeConverter (#1820)
* Fix not null when using JsonTypeConverter

* Run dart format on writer

Co-authored-by: Alexander Wilde <alexander.wilde87@gmail.com>
Co-authored-by: Simon Binder <oss@simonbinder.eu>
2022-04-25 16:21:01 +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
Simon Binder 2473cea469
Add `check()` to the Dart column builder (#1594) 2022-04-18 20:09:02 +02:00
Simon Binder 70e1d040ab
Avoid overriding `uniqueKey` if that's not needed 2022-04-08 21:21:00 +02:00
Daniel Brauner 3c75fbee9d New test cases 2022-04-06 22:07:28 +02:00
Daniel Brauner 5380a18450 Minor bug fixes 2022-04-06 20:14:13 +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 ff1912fc07 Merge remote-tracking branch 'simolus3/develop' into unique-constraint
# Conflicts:
#	drift/lib/src/ffi/database.dart
2022-04-02 20:13:44 +02:00
westito c584b5ccfd Fix failed analyze and test codes 2022-04-02 20:12:57 +02:00
westito 4713dd1a68 Add forgotten code change to table writer 2022-04-02 20:10:48 +02:00
Simon Binder 8e3259c971
Ignore all lints in generated code 2022-03-30 09:59:41 +02:00
westito 13d1ae0304 Make uniqueKey handle multiple keys 2022-03-28 16:29:01 +02:00
westito 27192f11c4
Fix null aware type converter data class field suffix (#1775) 2022-03-28 00:05:15 +02:00
westito 5d4c5dea70 Add uniqueKey to table definition 2022-03-22 17:00:27 +01:00
westito 51d2328998 Add unique() to column builder 2022-03-22 15:21:37 +01:00
Tomaž Marhat c0bd703122
fix: wrap element name inside ReCase (#1762) 2022-03-20 11:36:06 +01:00
Simon Binder 231c270fb1
Prepare 1.5.2 release of `drift_dev` 2022-03-15 19:41:45 +01:00
Simon Binder 5a2b6a36cc
Fix crash when reading type converters (#1757) 2022-03-15 16:51:30 +01:00
Simon Binder 35d5ff35c8
Prepare minor `drift_dev` release 2022-03-14 21:27:36 +01:00
Simon Binder a60a795c66
Auto-migrate usages of `moor_flutter` 2022-03-14 21:04:04 +01:00
Simon Binder c6edcdf3e8
Prepare drift 1.5.0 release 2022-03-13 15:54:45 +01:00
Simon Binder da212944ff
Replace old website and repository links 2022-03-13 15:52:15 +01:00
westito 05abe4de4c
Add cascaded expression support to DSL view parser (#1751)
* Add cascaded expression support to DSL view parser

* Fix view sample query
2022-03-13 00:47:02 +01:00
Simon Binder b25921a362
Write column getter into schema file (#1739) 2022-03-09 23:02:52 +01:00
Simon Binder 56f048b42f
Add test for self-references in Dart tables 2022-03-08 09:54:50 +01:00
Simon Binder 61dc1f17b8
Name schema exports automatically (#1721) 2022-03-02 17:25:30 +01:00
Simon Binder db1a4e2827
Fix `validateDatabaseSchema` 2022-03-01 20:41:00 +01:00
Simon Binder cb46e2c07e
API to validate schema at runtime (#1718) 2022-03-01 18:10:19 +01:00
Simon Binder f4eec69810
Fix reading schema files 2022-02-26 22:28:04 +01:00
Simon Binder 9ec7465fca
Migrate rest of `drift_dev` to null safety 2022-02-26 22:20:17 +01:00
Simon Binder 93d328f056
Rename `moor` to `drift` in `sqlparser` 2022-02-26 21:38:28 +01:00
Simon Binder ce31515c07
Fix type issue for `LIST` queries 2022-02-25 21:25:06 +01:00
Simon Binder 6bb870458f
Analysis for sqlite 3.38 2022-02-23 22:06:42 +01:00
Simon Binder 6184892217
Add more docs, changelog 2022-02-18 15:09:51 +01:00
westito 9bcac38e98 Add tests for custom data class parent 2022-02-18 10:50:03 +01:00
westito e35a4028b5 Merge branch 'custom_parent_class' of github.com:westito/drift into custom_parent_class 2022-02-18 10:12:43 +01:00
westito e56260740d
Update drift_dev/lib/src/analyzer/data_class.dart
Co-authored-by: Simon Binder <oss@simonbinder.eu>
2022-02-18 10:12:35 +01:00
westito d846655e1d Merge remote-tracking branch 'simolus3/develop' into custom_parent_class 2022-02-18 10:11:59 +01:00
Simon Binder 0869bdc620
Remove empty file 2022-02-17 16:28:34 +01:00
Simon Binder 83deb5bb4d
Include views in generated accessors 2022-02-17 16:23:02 +01:00
Simon Binder 101db403c6
Merge pull request #1682 from westito/type-converter-workaround
TypeConverter not existent type argument class workaround
2022-02-14 22:15:57 +01:00
westito d6692b13c2 Fix dynamic type check 2022-02-14 19:59:46 +01:00
westito 062b00d635 TypeConverter not existent type argument class workaround
(cherry picked from commit fe193e037bc51dc34d65507c8df6fba66759d54e)
2022-02-14 19:29:24 +01:00
westito 3872f14d2f Fix error message in parent class parse 2022-02-14 14:24:22 +01:00
westito bfc4921809 Allow dynamic as type parameter 2022-02-14 14:20:21 +01:00
westito affac25a77 Add view dsl as() expression parse error 2022-02-14 10:15:31 +01:00
westito 46ca0462bf Add type checks to parent class option 2022-02-14 10:03:46 +01:00
westito 4c2e74d5e0 Add generics to parent class option 2022-02-13 08:13:42 +01:00
westito afb5e8157c Add custom parent class option to generated data classes 2022-02-12 19:36:54 +01:00
Simon Binder c58c93c348
Prepare changelogs for 1.4 release 2022-02-09 16:47:22 +01:00
Simon Binder 661227c4c3
Prepare release 2022-02-09 16:23:43 +01:00
Simon Binder 33e3610fea
Fix analysis warnings added in Dart 2.16 2022-02-08 20:59:59 +01:00
Simon Binder 36815c0b88
Merge pull request #1638 from LeFrosch/develop
Support for nested queries like (#1634)
2022-01-31 13:21:24 +01:00
Simon Binder b442a82f93
Move nested query containers into model directory 2022-01-31 12:58:36 +01:00
Simon Binder 1d1d0c783a
Fix CI test failures 2022-01-29 21:50:33 +01:00
Simon Binder 6b6cd30a0c
Move nested query analysis to drift_dev 2022-01-28 21:55:03 +01:00
Simon Binder fe0b976b92
Fix invalid use of alias in writer test 2022-01-26 22:12:32 +01:00
Simon Binder 7d56497c18
Some plugin fixes 2022-01-24 17:25:24 +01:00
Daniel Brauner 2035bf0af9 Fix resultset name bug 2022-01-23 18:44:33 +01:00
Daniel Brauner a9fd12e565 Fixed 0 workaround 2022-01-23 17:08:32 +01:00
Daniel Brauner e50ce8a8f7 Add linter for double nested queries and bug fixes 2022-01-20 20:21:06 +01:00
Daniel Brauner b5acbbf374 Bug fixes and support for dart placeholder 2022-01-20 12:08:39 +01:00
Simon Binder 2a347b2f40
Analyze views before other entities 2022-01-19 20:54:02 +01:00
Daniel Brauner add33e339c Fix copied comments :) 2022-01-18 22:56:17 +01:00
Daniel Brauner cc3cfea5fa Split map function in async map and sync map 2022-01-18 22:50:33 +01:00
Daniel Brauner d74860ec49 Add support for nested query variables 2022-01-18 22:21:54 +01:00
Simon Binder 672bb930c8
Add common methods as extension on table (#1613) 2022-01-18 22:11:09 +01:00
Simon Binder 7bfa00e8b4
Make database of tables accessible for Dart API 2022-01-18 21:50:51 +01:00
Daniel Brauner e99b66486d Fixed trailing comma bug and nameOfCreationMethod 2022-01-17 23:23:39 +01:00
Daniel Brauner 23de4c5cee Add code generation for nested result queries 2022-01-17 22:19:31 +01:00
Daniel Brauner 0e331933af Add rename support for nested star columns 2022-01-17 10:21:06 +01:00
Simon Binder 41472d64ec
Merge branch 'develop' 2022-01-14 19:35:27 +01:00
Simon Binder d6d52718d4
Prepare 1.3.0 release 2022-01-14 19:19:14 +01:00
Simon Binder 6555523384
Prepare drift_dev release for latest analyzer 2022-01-10 16:26:50 +01:00
Simon Binder 35dae8b044
Support latest analyzer 2022-01-10 16:25:36 +01:00
Simon Binder 48f1aa8437
Support latest analyzer 2022-01-10 13:09:47 +01:00
Simon Binder e7580ca912
Prepare 1.2.0 release 2021-12-30 17:28:56 +01:00
Simon Binder 0bad799b82
Proper support for views in select streams 2021-12-25 20:30:16 +01:00
Simon Binder 98c21c13b3
Prepare to release 1.1.1 2021-12-23 17:38:49 +01:00
Simon Binder 41825e058e
Rollback if commit fails (#1589) 2021-12-19 19:45:20 +01:00
Simon Binder 36b23942f4
Consider inheritance when checking for getters 2021-12-19 11:48:49 +01:00
Simon Binder 102d0d9246
Use correct sqlparser dependency in drift_dev 2021-12-19 11:48:49 +01:00
渣渣辉 a638428495
Fix ViewParser not support alias column 2021-12-13 20:57:28 +08:00
Simon Binder bf0dcfb693
Prepare drift 1.1 release 2021-12-11 13:17:37 +01:00
Simon Binder 19bd92bfd9
Remove redundant imports 2021-12-09 14:10:51 +01:00
Simon Binder 44281bebaf
Support for STRICT tables in drift files 2021-12-03 22:11:44 +01:00
westito d22bbcbadf Merge remote-tracking branch 'simolus3/develop' into views 2021-12-02 09:20:02 +01:00
Simon Binder 2999df449d
Fix schema verifier around virtual tables 2021-12-01 21:07:47 +01:00
Simon Binder 5fcdbed46f
Add docs 2021-12-01 17:05:58 +01:00
westito 02ff9b8cdc Merge remote-tracking branch 'simolus3/develop' into views 2021-11-30 21:44:39 +01:00
westito f3e9fe56da Fix parsing view references 2021-11-30 20:42:20 +01:00
westito 0e61940d70 add join useColumns option to selectOnly 2021-11-30 15:20:19 +01:00
westito fc9c2d6171 Remove unnecessary import from virtual table test 2021-11-28 19:38:14 +01:00
westito b4b76c95bc Fix typo in virtual table unknown function test 2021-11-28 19:35:48 +01:00
westito 5d5518f2a4 Fix virtual table test 2021-11-28 19:33:31 +01:00
Simon Binder 0dde9ba78a
Merge pull request #1566 from westito/missing_override
Override missing in generated code
2021-11-28 19:26:52 +01:00
westito 254e33f5bb Check references only on Database 2021-11-28 17:48:44 +01:00
westito 203504de93 Override missing in generated code 2021-11-28 13:30:05 +01:00
westito 810d9f03a5 Modify DSL view to accept expression instead of column 2021-11-27 18:22:04 +01:00
westito a6bd75d780 fix post-merge issues 2021-11-26 14:15:54 +01:00
westito 72260196be Merge remote-tracking branch 'simolus3/develop' into views
# Conflicts:
#	drift_dev/lib/src/writer/tables/data_class_writer.dart
2021-11-26 14:10:10 +01:00
boyan b5d32ee21a fix unknown function cause crash 2021-11-26 13:08:26 +08:00
Simon Binder 49d21d2796
Merge pull request #1559 from westito/null_aware_type_converters
Add null aware type converter option
2021-11-25 21:40:22 +01:00
westito 9359defcac Add null aware type converters option 2021-11-24 23:49:13 +01:00
Simon Binder a00869a62b
Migrate .moor.dart files (#1558) 2021-11-24 23:11:59 +01:00
westito ea78584793 Merge remote-tracking branch 'simolus3/develop' into views 2021-11-24 19:06:31 +01:00
Simon Binder 214fbe2409
Don't crash for unknown column in PK 2021-11-19 15:43:50 +01:00
westito 876f6850f5 Add dsl view generator 2021-11-15 00:15:53 +01:00
westito ea6dc02964 Refactor drift views 2021-11-13 12:27:07 +01:00
westito 70bcefdaf3 Rename View to ViewInfo 2021-11-12 19:38:45 +01:00
westito fad654a5aa
PostgreSQL support (#1507)
Support PostgreSQL as a dialect in the main package and with an implementation provided in another package.

Co-authored-by: Simon Binder <oss@simonbinder.eu>
2021-11-11 14:40:41 +01:00
Simon Binder f2d0864890
Support generated columns in the parser 2021-11-07 22:10:08 +01:00
Simon Binder 3469bade62
Initial support for generated columns 2021-11-07 21:20:12 +01:00
Simon Binder 38a8ad136f
Merge pull request #1492 from westito/generate_tocompanion
Add 'toCompanion' generator for custom row classes
2021-10-20 23:39:18 +02:00
westito 40f4c1bd1f Rewrite toCompanion to insertable 2021-10-20 16:58:27 +02:00
Simon Binder 6bcb0070b0
Write explicitly inxed variables in new code 2021-10-19 18:15:53 +02:00
westito a5e4a7851e Remove named function requirements, fix name matching, update test 2021-10-19 15:58:39 +02:00
westito 9b4f25718d Moved generateToCompanion option to ExistingRowClass 2021-10-19 09:30:57 +02:00
westito 610acfad61
Apply suggestions from code review
Co-authored-by: Simon Binder <oss@simonbinder.eu>
2021-10-19 09:14:31 +02:00
westito b8fb002c41 Change toCompanion generator builder option to @UseRowClass parameter 2021-10-18 15:17:12 +02:00
westito 958302c253 Add custom row class toCompanion generator 2021-10-17 20:09:53 +02:00
Simon Binder 4eb430c42f
Support foreign key references in Dart tables 2021-10-17 12:21:32 +02:00
Simon Binder 849b0de040
Accept drift-named schema files 2021-10-14 21:44:44 +02:00
Simon Binder b574cb0b03
Prepare to release moor 4.6.1, drift_dev 1.0.2 2021-10-13 22:08:38 +02:00
Simon Binder 662b9d5721
Fix analysis plugin for moor, migrate options 2021-10-12 17:36:10 +02:00
Simon Binder 7d41e42c78
Prepare moor 4.6.0 release 2021-10-12 14:26:53 +02:00
Simon Binder c2bd6f27a5
Prepare a round of releases 2021-10-11 15:55:01 +02:00
Simon Binder bb5f08f90f
Also add plugin to drift 2021-10-11 10:25:50 +02:00
Simon Binder 331d600df3
Fix resolving Dart code in drift files 2021-10-10 22:01:59 +02:00
Simon Binder 348ac2e910
Add boilerplate files to new drift packages 2021-10-10 21:18:27 +02:00
Simon Binder e91207e9e4
Start preparing the documentation for the new name 2021-10-09 21:43:30 +02:00
Simon Binder aa8e3f7781
Migrate built_value example 2021-10-09 17:55:21 +02:00
Simon Binder cc99b1372a
Migrate migration example to drift 2021-10-09 17:10:34 +02:00
Simon Binder dc5055f585
Improve UX of migrator 2021-10-09 16:30:46 +02:00
Simon Binder cfbea9fd57
Migrate web workers example to drift 2021-10-08 23:33:39 +02:00
Simon Binder aa7a88172d
Fix generation for builds through moor_generator 2021-10-08 23:15:37 +02:00
Simon Binder 7358f545ac
Fix tests and generation in drift package 2021-10-08 22:40:58 +02:00
Simon Binder 3a56de1830
Fix imports in drift_dev 2021-10-08 22:01:18 +02:00
Simon Binder 2219a15e5f
Fix tests of main package, imports in dev 2021-10-08 21:51:01 +02:00
Simon Binder fcbef06b7c
Move generator to drift_dev 2021-10-08 18:10:48 +02:00