Commit Graph
100 Commits
Author SHA1 Message Date
Simon Binder 530523abdd Remove defunct analyzer plugin 2024-12-18 22:15:39 +01:00
Simon Binder 6a30ee9789 Update dev dependencies 2024-12-18 22:09:47 +01:00
Simon Binder 03eddb5e3e Schema export: Resolve defaults
Closes https://github.com/simolus3/drift/issues/3379
2024-12-18 18:11:18 +01:00
Simon Binder 4ee1c40273 Improve error message for unsupported platforms 2024-12-18 17:10:47 +01:00
Simon Binder 0f48c51a68 Fix wasm support in drift_flutter 2024-12-18 16:57:00 +01:00
Simon Binder 1146a69782 Fix custom companion names
Closes https://github.com/simolus3/drift/issues/3375
2024-12-15 22:13:51 +01:00
Simon Binder 95c21fc363 Remove editor settings that should be ignored 2024-12-13 15:44:57 +01:00
Simon Binder 97d92bd62b Fix wasm tests 2024-12-12 17:45:54 +01:00
Simon Binder 7f18724943 Add Dart API to build compound statements
Closes https://github.com/simolus3/drift/issues/3346
2024-12-07 01:21:40 +01:00
Simon Binder fdfaff9383 Prepare drift_dev patch release 2024-12-04 22:38:18 +01:00
Simon Binder 53b5afcda7 Fix embedding Dart expressions without type 2024-12-04 13:21:52 +01:00
Simon Binder 6a7f6df598 Add changelog entry for dart2wasm fix 2024-11-30 23:20:04 +01:00
Simon Binder 35814533a6 Fix alterTable without legacy alter table
Closes https://github.com/simolus3/drift/issues/3088
2024-11-30 23:13:55 +01:00
Simon Binder 955f234cd6 Fix insert from select with upsert
Closes https://github.com/simolus3/drift/issues/3362
2024-11-30 22:04:44 +01:00
Simon Binder b5660f66b1 Prepare release 2024-11-28 20:35:33 +01:00
Simon Binder 492d35c316 Document custom companions better 2024-11-28 00:09:57 +01:00
Simon Binder cd1eb0a1d4 Restore broken overview on migration helpers 2024-11-26 17:31:36 +01:00
Simon Binder e4e58827b7 Use external package for snippets (#3325)
Use existing `code_snippets` package to build highlights instead of a drift-specific builder.
2024-11-23 23:46:22 +01:00
Simon Binder bf4a5349e1 Propagate types with known nullability first
Closes https://github.com/simolus3/drift/issues/3351
2024-11-22 17:56:49 +01:00
Simon Binder 06fdbd7cc4 Fix links on custom types page
Closes https://github.com/simolus3/drift/issues/3349
2024-11-22 00:31:26 +01:00
Simon Binder 2c29a3529c Add missing redirect for getting started page 2024-11-21 09:53:52 +01:00
Simon Binder ae7550107c Clearly mention that integrity tests are samples 2024-11-20 22:13:33 +01:00
Simon Binder 7d577c0a29 make-migrations: Fix version numbers and imports
Closes https://github.com/simolus3/drift/issues/3345
2024-11-19 23:42:54 +01:00
Simon Binder d9968e18a9 Test that customStatement can run multiple stmts 2024-11-16 22:10:06 +01:00
Simon Binder 8401d5e9e1 Ping control port for unreachable servers
Closes https://github.com/simolus3/drift/issues/3339
2024-11-14 19:08:23 +01:00
Simon Binder b2a0d50252 Add exception test on scanning vs parsing 2024-11-11 22:02:16 +01:00
Simon Binder c2b66deb20 Update table docs 2024-11-09 22:45:42 +01:00
Simon Binder ec841e7935 Fix lint in new test 2024-11-04 22:10:20 +01:00
Simon Binder ca6a407aae Option to disable timers when closing streams
Closes https://github.com/simolus3/drift/issues/3323
2024-11-04 22:01:21 +01:00
Simon Binder 67a1f7bdfa Fix strict + without rowid tables
Closes https://github.com/simolus3/drift/issues/3324
2024-11-04 21:14:55 +01:00
Simon Binder d9c9ed8cf7 Make dbstat an opt-in module 2024-11-02 21:52:38 +01:00
Simon Binder 3d446ab81e Support Dart views in schema tools
Closes https://github.com/simolus3/drift/issues/3285
2024-11-02 19:04:48 +01:00
Simon Binder dd1bbb9c62 Support runtime schema validation on the web
Closes https://github.com/simolus3/drift/issues/3317
2024-10-30 00:20:05 +01:00
Simon Binder db808c2fd7 Reformat 2024-10-29 22:40:08 +01:00
Simon Binder 178d8c605b Add option to make constructor args required
Closes https://github.com/simolus3/drift/issues/3299
2024-10-29 00:18:21 +01:00
Simon Binder 97e16fd9d0 Wasm: Introduce status report for worker errors 2024-10-28 00:20:14 +01:00
Simon Binder 6d31b37ae5 Fix missing parentheses around same precedence
Closes https://github.com/simolus3/drift/issues/3309
2024-10-26 20:53:53 +02:00
Simon Binder d4f6b1aa55 Adapt changelogs to include patch release 2024-10-25 00:30:19 +02:00
Simon Binder 8da6fed198 Update docs 2024-10-23 21:59:15 +02:00
Simon Binder c9e0734d82 Fix incorrect code for nullable type arguments
Closes https://github.com/simolus3/drift/issues/3300
2024-10-23 21:07:37 +02:00
Simon Binder 1a4aa06731 Add sqliteAny() column builder
Closes https://github.com/simolus3/drift/issues/3294
2024-10-23 20:36:54 +02:00
Simon Binder 7a098126b7 Skip test on Flutter 3.22 2024-10-23 15:53:18 +02:00
Simon Binder a652d32078 Fix analysis warnings in examples 2024-10-23 15:40:29 +02:00
Simon Binder 4c896a58ae Pass language version to formatter 2024-10-23 15:39:01 +02:00
Simon Binder 2cd568aea6 Fix infering result type of fts5 functions 2024-10-18 21:43:39 +02:00
Simon Binder f692bb1bbb Fix bm25 parameter count lint
Closes https://github.com/simolus3/drift/discussions/3292
2024-10-17 21:50:48 +02:00
Simon Binder 3c9986f855 Add documentation issue button 2024-10-16 18:49:37 +02:00
Simon Binder 6c1edb79e8 Allow crawling for release docs builds 2024-10-16 18:02:47 +02:00
Simon Binder 3c114328bf Prepare release
drift and drift_dev 2.21.0
sqlparser 0.39.1
drift_flutter-0.2.1
2024-10-14 22:08:18 +02:00
Simon Binder d7cc547836 Allow using group by on view without join
Closes https://github.com/simolus3/drift/issues/3284
2024-10-13 22:16:27 +02:00
Simon Binder f89a8ebe69 Merge pull request #3278 from simolus3/fix-related-relations-on-manager
manager: ignores references whose target column is a foreign key itself
2024-10-12 23:16:33 +02:00
Simon Binder bd80a46264 Devtools extension: Button to clear database
This drops contents and then calls beforeOpen, reinitializing the
database with the current migration.

Closes https://github.com/simolus3/drift/issues/3276
2024-10-10 23:41:23 +02:00
Simon Binder 4cadb06d80 Merge pull request #3250 from simolus3/drift_migrator_tool
feat: all in one migration command
2024-10-10 22:44:05 +02:00
Simon Binder 2ef6c60ba4 Attempt to fix Flutter CI 2024-10-10 22:24:03 +02:00
Simon Binder 04a046d195 Fix migration tooling test 2024-10-10 22:21:01 +02:00
Simon Binder 1d742e042d Add changelog entry 2024-10-10 22:15:12 +02:00
Simon Binder 1f40b14f24 Update migration tests template 2024-10-10 22:15:02 +02:00
Simon Binder d74c077538 Respect generate_manager for modular builds 2024-10-10 12:03:31 +02:00
Simon Binder 69f3c0254f Improve warning for missing not null constraint
Related to https://github.com/simolus3/drift/issues/3271
2024-10-08 22:46:01 +02:00
Simon Binder ba82b53fb6 Fix build_runner doctor check
Closes https://github.com/simolus3/drift/discussions/3272
2024-10-08 20:48:45 +02:00
Simon Binder 9912eec4f2 sqlparser: Track matching tokens for recovery
Closes https://github.com/simolus3/drift/issues/3273
2024-10-08 17:15:34 +02:00
Simon Binder dcf868d1b8 Include cycle for circular deserialization error 2024-10-06 13:41:46 +02:00
Simon Binder 83cbb1daaa Use postgres date time in example 2024-10-05 00:12:35 +02:00
Simon Binder ea2411a686 Document postgres limitations 2024-10-05 00:05:37 +02:00
Simon Binder ab93107224 Fix column references in versioned schema code (#3259)
When a column is defined like this:

```dart
  DateTimeColumn get creationTime => dateTime()
    .check(creationTime.isBiggerThan(Constant(DateTime(2020))))
    .withDefault(Constant(DateTime(2024, 1, 1)))();
```

Our generated code relies on the fact that `creationTime` as a getter is in scope for the copied `check` code (it is because we're generating columns in table classes). With versioned schemas however, we have an optimization that tries to not re-generate column code if it hasn't changed between different schema versions. With this generation mode, columns are no longer in scope for check constraints.

This fix relies on detecting columns in Dart code (so we see that the `creationTime` reference in `check` references a column) and then rewriting these expressions with a `CustomExpression` when generating code:

```dart
i1.GeneratedColumn<DateTime> _column_18(String aliasedName) =>
    i1.GeneratedColumn<DateTime>('birthday', aliasedName, true,
        check: () =>
            i2.ComparableExpr((i0.VersionedTable.col<DateTime>('birthday')))
                .isBiggerThan(i2.Constant(DateTime(1900))),
        type: i1.DriftSqlType.dateTime);
```

Closes https://github.com/simolus3/drift/issues/3219
2024-10-03 14:53:49 +02:00
Simon Binder 766581369d Translate error spans for custom constraints 2024-09-28 21:27:42 +02:00
Simon Binder f781aa3c5d Fix deadlock with remote transactions 2024-09-26 18:53:20 +02:00
Simon Binder 5d23dc605f Improve docs on type converters + json 2024-09-26 00:04:15 +02:00
Simon Binder 9b8f0cab46 Document how to use postgres with a conn pool
https://github.com/simolus3/drift/issues/3236
2024-09-23 20:57:27 +02:00
Simon Binder 86e3615318 Update Android code of example app 2024-09-22 22:28:23 +02:00
Simon Binder 14202c86c8 Add test around infering isolate serialization 2024-09-22 22:23:49 +02:00
Simon Binder 7464501b57 Prepare sqlparser release 2024-09-22 20:28:11 +02:00
Simon Binder e614f94a17 Use inferred serialization mode in drift flutter 2024-09-20 16:02:51 +02:00
Simon Binder e1d20c5c0f Infer serialization mode by sending a test message 2024-09-20 15:40:21 +02:00
Simon Binder 88ec430139 Merge pull request #3204 from simolus3/mkdocs-clean
Migrate to MkDocs
2024-09-17 19:59:11 +02:00
Simon Binder 475048c43c Pick up default constraint from customConstraints 2024-09-15 23:39:36 +02:00
Simon Binder 9e3a3c26d2 Include type args in named type reference 2024-09-15 23:24:42 +02:00
Simon Binder 57679505fd Include Dart check constraints in exported schema 2024-09-15 23:24:42 +02:00
Simon Binder 45758846d6 Fix drift dev tests 2024-09-13 21:39:12 +02:00
Simon Binder aafb9600be Include tokenizer errors in result instead of throwing
Closes https://github.com/simolus3/drift/issues/3218
2024-09-13 21:19:47 +02:00
Simon Binder 64d3019e15 Fix dependency overrides for devtools extension 2024-09-13 20:43:48 +02:00
Simon Binder 1362807b3c Use drift db viewer in devtools extension
Closes https://github.com/simolus3/drift/issues/3185
2024-09-13 00:18:39 +02:00
Simon Binder 0dce5e8f53 Prepare patch release 2024-09-10 21:33:49 +02:00
Simon Binder 74af262f7e Prepare minor drift release 2024-09-08 15:01:01 +02:00
Simon Binder 6dadf6894c Fix serving web tests manually 2024-09-08 14:51:05 +02:00
Simon Binder 2c98d15afb Support null in ColumnFilters.call 2024-09-07 21:35:24 +02:00
Simon Binder 50c620b79f Merge pull request #3202 from FMorschel/issue-template-docs
New docs issue template
2024-09-07 10:52:27 +02:00
Simon Binder 64612c951e Fix deserializing custom column types 2024-09-06 21:15:10 +02:00
Simon Binder ff97e2ab68 Include template in docs links 2024-09-06 21:14:02 +02:00
Simon Binder cd09cdc029 Fix schema dump test 2024-09-04 23:53:52 +02:00
Simon Binder 1607d4b2b3 Schema files: Support dialect constraints 2024-09-04 23:43:24 +02:00
Simon Binder f21d20e699 Add DevTools extension docs page 2024-09-04 22:49:19 +02:00
Simon Binder d3fa373c7f Mention drift_libsql on libsql page 2024-09-03 21:17:06 +02:00
Simon Binder 5854d323fe Add new serialization format for web
Closes https://github.com/simolus3/drift/issues/3195
2024-09-03 00:58:26 +02:00
Simon Binder b6a3adf076 Use sealed types in drift protocol 2024-09-03 00:58:25 +02:00
Simon Binder 0ebea34dea Merge pull request #3190 from celest-dev/feat/support-view-triggers
feat(drift_dev): Support view triggers in drift SQL
2024-09-02 21:14:33 +02:00
Simon Binder d1978fade9 Fix wasm cast errors in remote protocol
Closes https://github.com/simolus3/drift/issues/3194
2024-09-02 21:06:21 +02:00
Simon Binder 4ba38097f8 Merge pull request #3193 from FMorschel/Fixing-flutter-android
Recreating examples projects to migrate android
2024-09-01 20:47:24 +02:00
Simon Binder b872598f80 Support views for updates parameter 2024-09-01 20:32:47 +02:00
Simon Binder ed72f6fa19 Detect writes to views for write propagation 2024-09-01 20:26:17 +02:00