Created
September 20, 2019 15:05
-
-
Save knaeckeKami/8fafa26fab6bf830e0457f4566dc71de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:moor_bug_minimal/db.dart'; | |
import 'package:moor_flutter/moor_flutter.dart'; | |
void main() async { | |
Db db = Db(); | |
await (db.into(db.dummyTable).insertAll( | |
[DummyTableData(id: 1), DummyTableData(id: 2), DummyTableData(id: 3)])); | |
const paramList = [1, 2, 3]; | |
final result = await db.selectByIds(paramList); | |
if (result.isEmpty) { | |
debugPrint("i don't work"); | |
} else { | |
debugPrint("i work"); | |
} | |
final result2 = await db.customSelect( | |
'select * from dummy_table where id in (?,?,?)', | |
variables: [ | |
for (var $ in paramList) Variable.withInt($), | |
]); | |
if (result2.isEmpty) { | |
debugPrint("i don't work"); | |
} else { | |
debugPrint("i work"); | |
} | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return SizedBox.shrink(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment