Skip to content

Instantly share code, notes, and snippets.

@nmaruy27
Last active February 6, 2023 13:57
Show Gist options
  • Save nmaruy27/bcd57f56aae96c3dbca5335005dbc3e3 to your computer and use it in GitHub Desktop.
Save nmaruy27/bcd57f56aae96c3dbca5335005dbc3e3 to your computer and use it in GitHub Desktop.
driftで実行されるSQLを確認する方法
final stmt = select(tables);
stmt.where((t) => t.ticnameker.equals(name));
stmt.where((t) => t.updated.year.equals(date.year));
stmt.orderBy([(t) => OrderingTerm(expression: t.updated, mode: OrderingMode.desc)]);
// この2行で、実行SQLと条件に入る値の両方を出力できる
print('Query : ${stmt.constructQuery().sql}');
print('Variables : ${stmt.constructQuery().boundVariables}');
await stmt.get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment