Commit Graph

674 Commits

Author SHA1 Message Date
Simon Binder b5bc646187
Prepare patch release 2023-09-27 14:48:03 +02:00
Simon Binder 2edd75acbb
Fix defining indices on expressions (#2643) 2023-09-27 14:46:50 +02:00
Simon Binder db6ee5dda6
Update `build_resolvers` usage in tests 2023-09-26 15:38:52 +02:00
Simon Binder f8ba56c8e2
Gracefully handle invalid views list of annotation
Fixes #2636
2023-09-25 15:29:09 +02:00
Simon Binder 5f8ea09030
Fix sqlparser dependency in drift_dev 2023-09-24 20:37:49 +02:00
Simon Binder 9f05897944
Prepare release 2023-09-24 16:17:07 +02:00
ValentinVignal 22b0a8fe36
doc: Update changelog 2023-09-21 11:36:53 +08:00
ValentinVignal d001ad533f
revamp: Rename actualTableNameStatic into $name 2023-09-21 11:36:10 +08:00
ValentinVignal 5b6571ec7f
doc: Update the changelogs 2023-09-20 21:59:31 +08:00
ValentinVignal 8161d96323
feat: Add getter actualTableNameStatic 2023-09-20 21:42:23 +08:00
Simon Binder 3b81babb53
Merge pull request #2617 from jmatth/fix-migration-conflicts
Preventing getter name conflicts in step-by-step migrations
2023-09-19 22:59:06 +02:00
Joshua Matthews 3dd2ff4a6f
Removing debug print 2023-09-19 14:38:35 -04:00
Simon Binder 2f732202b0
Show correct annotation name in tables error 2023-09-19 20:32:30 +02:00
Joshua Matthews f69a0db911
Adding unit tests for SchemaVersionWriter 2023-09-19 11:12:59 -04:00
Joshua Matthews 73e417d451
Adding comment explaining name reservation during codegen 2023-09-19 09:54:52 -04:00
Josh Matthews 0af636edd0
Fixing typo in drift_dev/lib/src/writer/writer.dart
Co-authored-by: Simon Binder <oss@simonbinder.eu>
2023-09-19 09:53:27 -04:00
Joshua Matthews 10e0336310
Moving name reservation into Scope 2023-09-18 11:46:32 -04:00
Joshua Matthews ed1cd9f4e9
Preventing naming conflicts between table columns and existing class fields 2023-09-18 10:20:45 -04:00
Simon Binder 909c01bc5d
Add await before return in restoreOrResolve 2023-09-16 13:26:43 +02:00
Simon Binder 8300782662 Fix cli test 2023-09-14 18:32:43 +02:00
Simon Binder d0b176e290 Add docs and changelog entries 2023-09-14 18:28:55 +02:00
Simon Binder 1958dd5cae Add tests for Dart index 2023-09-14 18:21:14 +02:00
Simon Binder 78b520f55d Generate code for Dart-defined index 2023-09-14 17:57:57 +02:00
Simon Binder f81e9d8c4b Write new index information into schema file 2023-09-14 17:31:18 +02:00
Simon Binder 93b9cc512d Analyze index annotations for tables 2023-09-14 15:37:21 +02:00
Simon Binder 0fd19ab576
Fix drift_dev tests 2023-09-10 22:46:50 +02:00
Simon Binder da0392c7ce
Update packages used in documentation 2023-09-10 22:19:41 +02:00
Simon Binder 71f839d9b6
Prepare drift_dev hotfix release 2023-09-07 17:24:57 +02:00
Simon Binder 79dda8668b
Resolve imports across exports 2023-09-03 22:34:40 +02:00
Simon Binder 043d41ee73
Remove docs references to connect constructor 2023-08-31 10:57:54 +02:00
Simon Binder 303d738749
Prepare 2.11.1 release 2023-08-27 17:11:04 +02:00
Nikita Dauhashei f408991ee7
fix test 2023-08-26 20:54:38 +02:00
Nikita Dauhashei 9575612840
fix code generation for `enum` with generic 2023-08-26 20:18:03 +02:00
Simon Binder 895ff52761 Add API for finegrained control for steps by steps 2023-08-19 22:39:38 +02:00
Simon Binder fe242e5a17 Support `timediff` and `octet_length` 2023-08-17 17:30:45 +02:00
Simon Binder d84767b93d Support references to builtin tables (#2567) 2023-08-17 00:15:36 +02:00
Simon Binder 9c21e17d91
Add import references to generated insertable 2023-08-13 18:59:31 +02:00
Simon Binder f8635469d4
Emit direct imports in preprocess step 2023-08-13 11:10:31 +02:00
Simon Binder 7f6e22b892
Avoid using `findLibraryByName` 2023-08-12 23:28:47 +02:00
Simon Binder fb0533c204
Consistently normalize URLs in CLI tool 2023-08-12 22:28:48 +02:00
Simon Binder 92dd82f49c
Restore cache on a per-element basis 2023-08-12 22:03:58 +02:00
Simon Binder 90d8fdc61a
Also optimize looking up Dart references 2023-08-12 14:51:49 +02:00
Simon Binder 788420b614
Avoid resolving all transitive imports in build 2023-08-12 14:35:16 +02:00
Simon Binder f857cb17b5
Prepare 2.11.0 release 2023-08-11 15:20:22 +02:00
Simon Binder 29ba50a0ca
Merge pull request #2521 from BananaMasterz/develop
adding support for MariaDB dialect
2023-08-03 17:49:57 +02:00
Simon Binder 1a4ac27415
Find variables reliably 2023-08-01 11:20:05 +02:00
Simon Binder 2cca2f517e
Desugar duplicate variables 2023-07-31 23:47:41 +02:00
Simon Binder 525ab27006
Add `preamble` builder option 2023-07-30 23:14:32 +02:00
Simon Binder 28e44cbea8
First support for MariaDB in compiled queries 2023-07-27 11:16:58 +02:00
Simon Binder 1c5432026c
Merge branch 'develop' into Banana-develop 2023-07-27 10:29:25 +02:00
Simon Binder 5e32e549ea
Add changelog entry for`dialects` option 2023-07-27 10:22:37 +02:00
Simon Binder 8d3f490604
Add multi-dialect generation option 2023-07-26 23:59:06 +02:00
Simon Binder 94c4c1a8e0
Document #2537 better 2023-07-25 23:24:08 +02:00
Simon Binder e433cff932
Update docs for nested columns 2023-07-24 21:10:04 +02:00
Simon Binder 5ed6115b0d
Fix outdated tests in drift_dev 2023-07-24 20:54:32 +02:00
Simon Binder 6a36957a85
Don't generate async mapping if not needed 2023-07-24 20:50:43 +02:00
Simon Binder 941409381b
Tests for generalized nested columns 2023-07-24 20:08:49 +02:00
BananaMasterz 78d6064634 introduce SqlDialect.escape DO NOT MERGE until Column.escapedName is fixed (currently hardcoded for mariadb) 2023-07-24 16:32:35 +03:00
Simon Binder 5b7e011021
Fix generation in drift package 2023-07-24 00:14:40 +02:00
Simon Binder 3f74d65e69
Support nested columns for any result set 2023-07-23 23:57:00 +02:00
BananaMasterz d2c3532c3f using backticks instead of double quotes to escape and adding bool check constraint for mariadb
DO NOT MERGE THIS since Column.escapedName is hardcoded for mariadb dialect!
2023-07-19 18:17:48 +03:00
BananaMasterz 192472201f auto increment support for MariaDB 2023-07-19 11:42:44 +03:00
Simon Binder 625eacf5f1
Add parseMultiple API to sqlparser (#2519) 2023-07-16 00:29:29 +02:00
Simon Binder d0db9ac02f
Prepare 2.10 drift release 2023-07-13 16:53:51 +02:00
Simon Binder b0946df3b7
Warn about implicitly added Dart tables 2023-07-05 20:51:30 +02:00
Simon Binder 312fa3219f
Add docs for step-by-step migrations 2023-07-01 18:11:41 +02:00
Simon Binder ed9aeb866a
Add step-by-step migration API 2023-07-01 16:41:22 +02:00
Simon Binder 8b7872fc67
Start with generator for all schema versions 2023-06-28 15:54:32 +02:00
Simon Binder 81315c3d69
Migrate mentions of `flutter pub run` 2023-06-19 16:09:47 +02:00
Simon Binder 5fe28cbf37
Update dependency constraint to drift in drift_dev 2023-06-18 21:32:30 +02:00
Simon Binder af917b1f71
Prepare 2.9.0 release 2023-06-18 16:37:51 +02:00
Simon Binder d465776726
Merge branch 'web-v2' into develop 2023-06-17 22:51:49 +02:00
Simon Binder b7b1bcb99d
Add changelog entry for fatal warnings 2023-06-13 22:13:23 +02:00
Simon Binder 4411e0c459
Add `fatal_warnings` build option 2023-06-13 22:08:07 +02:00
Simon Binder 9f2405be26
Merge branch 'develop' into web-v2 2023-06-04 22:10:44 +02:00
Simon Binder 232140c083
Prepare minor release 2023-06-01 11:26:57 +02:00
Simon Binder e2fe4228ad
Make driver error fatal in tests 2023-05-30 13:53:03 +02:00
Simon Binder 054b91b507
Don't warn about unrecognized Dart imports 2023-05-23 16:18:01 +02:00
Simon Binder 451bc9c930
Load imports for Dart files too (#2433) 2023-05-23 15:58:15 +02:00
Simon Binder 5db8d58b72
Add some protocol messages for wasm init 2023-05-18 22:24:09 +02:00
Simon Binder f5ae390284
Better mechanism to determine table count 2023-05-16 11:09:29 +02:00
Simon Binder a3ca77b5f8
Always write qualified column references from SQL 2023-05-16 10:51:33 +02:00
Simon Binder f11d1bdd83
Prepare publishing drift_dev 2.8.1 2023-05-15 08:58:37 +02:00
Simon Binder 1d63ccb3f1
Fix annotating top-level types and extensions
By not using a `SimpleIdentifier` AST node for class and extension
names, the code used to detect imports for Dart code was broken.
Closes #2423
2023-05-14 21:54:51 +02:00
Simon Binder 78299f30d3
Fix expectation in record writer test 2023-05-12 22:45:43 +02:00
Simon Binder 28417c52af
Fix lints and warnings added in Dart 3.0 2023-05-12 22:42:21 +02:00
Simon Binder 20b75bd7e3
Use unifying type visitor instead of custom logic 2023-05-10 22:28:51 +02:00
Simon Binder 18868221d9
Support doc comments for columns in drift files 2023-05-10 12:00:44 +02:00
Simon Binder 1dad8a00d8
Prepare 2.8.0 release 2023-05-10 10:24:58 +02:00
Simon Binder 052abfbab2
Add safety fallback for new types being added 2023-05-10 10:18:24 +02:00
Simon Binder 45dc099440
Support analyzer 5.12 2023-05-10 10:13:16 +02:00
Simon Binder ceba4e3c1b
Remove unused imports 2023-05-03 19:01:41 +02:00
Simon Binder b2b37666bd
Add version for intermediate sources if needed 2023-05-03 17:45:39 +02:00
Simon Binder 6bb2c3d2c5
Support named constructors for rows in drift file 2023-04-23 16:21:31 +02:00
Simon Binder 5caa948243
Improve error handling for missing tables in query 2023-04-19 23:24:24 +02:00
Simon Binder f8e7d2335a
Raise minimum language version to 2.13
Drift uses generalized typdefs in generated code, which only became
available in Dart 2.13.
2023-04-12 21:27:06 +02:00
Simon Binder d7f1bfb61c
Prepare 2.7.0 release 2023-04-10 23:33:36 +02:00
Simon Binder d02343c8cc
Add regresion test for Dart component in having 2023-04-08 16:02:40 +02:00
Simon Binder a6549425ef
Serialize and restore file dependencies too 2023-03-25 16:29:07 +01:00
Simon Binder d6e074e704
Fix `validateDatabaseSchema` in schema tests 2023-03-23 17:56:50 +01:00
Simon Binder 9bebf4a81e
Prepare release 2023-03-20 21:39:41 +01:00
Simon Binder 023512cae3
Support latest cli_util in drift_dev 2023-03-20 17:18:50 +01:00
Simon Binder 0453988233
Remove client default code from schema tests again 2023-03-16 19:31:41 +01:00
Simon Binder ba86f1aa89
Use correct variable indexes around nested queries 2023-03-15 17:48:36 +01:00
Simon Binder 26434ca40b
Fix typo in test that is now an error 2023-03-13 22:46:43 +01:00
Simon Binder 849f245f53
Warn about invalid custom foreign key constraint 2023-03-13 22:30:14 +01:00
Simon Binder e0d5520ee1
Analyze foreign keys as custom constraint on cols 2023-03-13 21:51:16 +01:00
Simon Binder adc2e22c46
Ignore lints in generated schema code 2023-03-03 20:57:32 +01:00
Simon Binder cc16156c84
Merge branch 'postgres3' into develop 2023-02-25 13:16:33 +01:00
Simon Binder 5166e5d294
Add rowid parameter to companions 2023-02-19 13:46:58 +01:00
Fabian Freund dc9a9e2db3 fix parsing of nested cte's 2023-02-15 10:18:26 +01:00
Simon Binder 21ff422f19
Support `@create` queries in modular mode (#2313) 2023-02-12 12:44:47 +01:00
Simon Binder ca75323a6a
Fix postgres tests 2023-02-09 10:53:41 +01:00
Simon Binder c2c1b3c6ae
Merge `latest-release` into `develop` 2023-02-08 10:58:53 +01:00
Simon Binder 6b216c1683
Fix expected import for Uint8List in test 2023-02-07 22:38:33 +01:00
Simon Binder cd2cf1f3b3
Fix blob columns with modular code generation (#2306) 2023-02-07 22:27:53 +01:00
Simon Binder deb1b91d41
Escape postgres keywords in generated SQL 2023-02-05 14:28:19 +01:00
Simon Binder 94332a126f
Prepare to release drift_dev 2.5.1 2023-02-01 10:52:29 +01:00
Simon Binder ab10fd7f6f
Resolve columns sequentially 2023-02-01 10:50:20 +01:00
Simon Binder f9912d5455
Properly unify result classes with list columns 2023-01-31 22:58:30 +01:00
Simon Binder b935d27248
Add test for #2292 2023-01-31 22:25:58 +01:00
Simon Binder d35c8f07d4
Prepare drift_dev re-release 2023-01-30 08:58:59 +01:00
Paulis Gributs 1c282afe4f
Fix sqlparser error
SQL parser is set to a non-existent version in the publication specification and prevents drift_dev 2.5.0 from being used.
2023-01-29 17:58:49 +00:00
Simon Binder e42dd9155e
Prepare 2.5.0 release 2023-01-29 16:25:20 +01:00
Simon Binder 0d354b3bec
Deprecate special connect constructor 2023-01-28 16:53:35 +01:00
Simon Binder 83fad8426e
Make `generate_connect_constructor` the default 2023-01-28 16:14:27 +01:00
Simon Binder bff8d6c6a1
Fix nullability issues around record types 2023-01-27 17:12:49 +01:00
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 cd41eed105
Migrate away from `JsonKey.ignore` 2023-01-20 18:30:48 +01:00
Simon Binder 6e35abb9c9
Add `IS` operator to Dart query builder 2023-01-12 16:53:43 +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
Ignacio Torres Masdeu 8cbab9af24
Fix typo 2023-01-08 16:40:09 +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 fafcf114a3
Prepare new minor release 2023-01-02 23:56:28 +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 31d58fbf77 Sort schema versions 2023-01-01 23:22:31 +00:00
Alexander Wilde 624c145cfd companions flag shouldn't depend on data classes flag 2023-01-01 20:17:40 +00:00