1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Flutter】SQLiteをTablePlusで確認する

Posted at

Flutterアプリでは、sqfliteパッケージなどを使ってローカルにSQLiteデータベースを保存できます。開発中に中身を確認したい場合、TablePlusを使うとGUIで簡単にデータを閲覧・編集できます。ここではシミュレータでの基本的な確認手順を紹介します。

1. データベースファイルの場所を特定する

Flutterアプリでは通常、SQLiteファイルは端末内のアプリ専用ディレクトリに保存されます。
パスを取得するには、getDatabasesPath()を使用します。

import 'package:sqflite/sqflite.dart';

void printDbPath() async {
  var databasesPath = await getDatabasesPath();
  print(databasesPath); // -> DBへのパス
}

2. TablePlusで開く

TablePlusを起動

「新規接続」→「SQLite」を選択

取得したSQLiteファイルを指定して開く(赤枠部分にパスを入力、もしくはSelect file...からファイルを選択)
スクリーンショット 2025-04-29 11.19.14.png

これで、アプリのデータベース内容をTablePlusで自由に閲覧・編集できます!

参考文献

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?