powershell:sqlite_table_list
文書の過去の版を表示しています。
SQLiteでテーブルリストを表示する
# SQLite の DLL を読み込み Add-Type -Path ".\System.Data.SQLite.dll" # SQLite データベースファイルのパス $dbPath = ".\test.db" # 接続文字列 $connectionString = "Data Source=$dbPath;Version=3;" # 接続を開く $connection = New-Object System.Data.SQLite.SQLiteConnection($connectionString) $connection.Open() # SQL: SQLite の内部テーブル sqlite_master からテーブル名を取得 $command = $connection.CreateCommand() $command.CommandText = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;" # 実行 $reader = $command.ExecuteReader() Write-Host "=== テーブル一覧 ===" while ($reader.Read()) { Write-Host $reader["name"] } # 後処理 $reader.Close() $connection.Close()
powershell/sqlite_table_list.1756217511.txt.gz · 最終更新: 2025/08/26 23:11 by mikoto