mirror of https://github.com/AMT-Cheif/drift.git
Add test and changelog entry
This commit is contained in:
parent
168a9bfa59
commit
e02a814f5c
|
@ -6,6 +6,7 @@
|
|||
which tables are affected by the custom statement.
|
||||
- For `STRICT` tables in drift files declaring a `ANY` column, drift will now
|
||||
generate a mapping to the new `DriftAny` type.
|
||||
- Add `likeExp` to generate `LIKE` expression with any comparison expression.
|
||||
- Fix `UNIQUE` keys declared in drift files being written twice.
|
||||
- Fix `customConstraints` not appearing in dumped database schema files.
|
||||
- Work-around an issue causing complex migrations via `Migrator.alterTable` not to
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
import 'package:drift/drift.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../../generated/todos.dart';
|
||||
import '../../test_utils/test_utils.dart';
|
||||
|
||||
void main() {
|
||||
const expression =
|
||||
CustomExpression<String>('col', precedence: Precedence.primary);
|
||||
final db = TodoDb();
|
||||
|
||||
test('generates like expressions', () {
|
||||
final ctx = GenerationContext.fromDb(db);
|
||||
expression.like('pattern').writeInto(ctx);
|
||||
|
||||
expect(ctx.sql, 'col LIKE ?');
|
||||
expect(ctx.boundVariables, ['pattern']);
|
||||
expect(expression.like('pattern'), generates('col LIKE ?', ['pattern']));
|
||||
expect(expression.likeExp(expression), generates('col LIKE col'));
|
||||
});
|
||||
|
||||
test('generates regexp expressions', () {
|
||||
|
|
Loading…
Reference in New Issue