はじめに
このプラグインのインストール手順とマークダウンガイドを含むセットアップコマンドをコピーできます。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-data-storage-sqlite`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/data-storage-sqlite/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
Installbun add @capgo/capacitor-data-storage-sqlitebunx cap syncインポート
「インポート」セクションimport { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';API オーバービュー
「API オーバービュー」セクションopenStore
「openStore」セクションストアを開く
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.openStore({} as capOpenStorageOptions);closeStore
「closeStore」セクションストアを閉じる
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.closeStore({} as capStorageOptions);isStoreOpen
「isStoreOpen」セクション店が開いているか確認する
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreOpen({} as capStorageOptions);isStoreExists
「isStoreExists」セクション店が存在するか確認する
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreExists({} as capStorageOptions);deleteStore
店を削除するクリップボードにコピー
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteStore({} as capOpenStorageOptions);setTable
既存の店にテーブルを追加または設定するクリップボードにコピー
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.setTable({} as capTableStorageOptions);set
「セット」のセクション__CAPGO_KEEP_0__を指定したキーと値でデータを保存
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.set({} as capDataStorageOptions);get
「取得」のセクション__CAPGO_KEEP_0__のデータキーに対応するデータ値を取得
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.get({} as capDataStorageOptions);remove
「削除」のセクション__CAPGO_KEEP_0__を指定したキーでデータを削除
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.remove({} as capDataStorageOptions);clear
「クリア」のセクションデータストアをクリア (すべてのキーを削除)
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.clear();iskey
「iskey」セクションデータキーの存在を確認
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.iskey({} as capDataStorageOptions);keys
「keys」セクションデータキーのリストを取得
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.keys();values
「values」セクションデータ値のリストを取得
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.values();filtervalues
「filtervalues」セクションフィルターキーのデータ値のリストを取得
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.filtervalues({} as capFilterStorageOptions);keysvalues
「キー値」セクションデータのキー/値ペアリストを取得
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.keysvalues();isTable
「テーブルチェック」セクション現在のストアのテーブルが存在するかどうかを確認
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isTable({} as capTableStorageOptions);tables
現在のストアのテーブルリストを取得クリップボードにコピー
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.tables();deleteTable
テーブルを削除クリップボードにコピー
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteTable({} as capTableStorageOptions);importFromJson
「importFromJson」セクションJSONファイルからデータベースをインポート
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.importFromJson({} as capStoreImportOptions);isJsonValid
「isJsonValid」セクションJSONオブジェクトの有効性を確認
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isJsonValid({} as capStoreImportOptions);exportToJson
データベースをJSONオブジェクトとしてエクスポートクリップボードにコピー
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.exportToJson();「型の参照」セクション
クリップボードにコピーcapOpenStorageOptions
capOpenStorageOptionsセクションexport interface capOpenStorageOptions { /** * The storage database name */ database?: string; // default: // ios, android: storageSQLite // web : storageIDB /** * The storage table name */ table?: string; // default: // ios, android: storage_table // web: storage_store /** * Set to true for database encryption */ encrypted?: boolean; // only for ios and android /*** * Set the mode for database encryption * ["encryption", "secret","newsecret"] */ mode?: string; // only for ios and android}capStorageOptions
capStorageOptionsセクションexport interface capStorageOptions { /** * The storage name */ database: string;}capDataStorageResult
capDataStorageResultセクションexport interface capDataStorageResult { /** * result set to true when successful else false */ result?: boolean; /** * a returned message */ message?: string;}capTableStorageOptions
capTableStorageOptionsセクションexport interface capTableStorageOptions { /** * The storage table name */ table: string;}capDataStorageOptions
capDataStorageOptionsセクションexport interface capDataStorageOptions { /** * The data name */ key: string; /** * The data value when required */ value?: string;}capValueResult
capValueResultセクションexport interface capValueResult { /** * the data value for a given data key */ value: string;}capKeysResult
capKeysResultセクションexport interface capKeysResult { /** * the data key list as an Array */ keys: string[];}capValuesResult
capValuesResultセクションexport interface capValuesResult { /** * the data values list as an Array */ values: string[];}capFilterStorageOptions
capFilterStorageOptionsセクションexport interface capFilterStorageOptions { /** * The filter data for filtering keys * * ['%filter', 'filter', 'filter%'] for * [starts with filter, contains filter, ends with filter] */ filter: string;}capKeysValuesResult
capKeysValuesResultセクションexport interface capKeysValuesResult { /** * the data keys/values list as an Array of {key:string,value:string} */ keysvalues: any[];}capTablesResult
capTablesResultセクションexport interface capTablesResult { /** * the tables list as an Array */ tables: string[];}capStoreImportOptions
capStoreImportOptionsセクションexport interface capStoreImportOptions { /** * Set the JSON object to import * */ jsonstring?: string;}真実の源
「真実の源」と題されたセクションこのページはプラグインから生成されています。 src/definitions.ts公開された API がアップストリームで変更された場合に、再度同期を実行してください。