Interface d'accueil
Copiez un prompt de configuration avec les étapes d'installation et la guide Markdown complète pour ce plugin.
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.
Installation
Sous-titre « Installation »Vous pouvez utiliser notre configuration assistée par l'IA pour installer le plug-in. Ajoutez les Capgo compétences à votre outil d'IA en utilisant la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsEnsuite, utilisez la prompt suivante :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-data-storage-sqlite` plugin in my project.Si vous préférez la configuration manuelle, installez le plug-in en exécutant les commandes suivantes et suivez les instructions spécifiques à la plateforme ci-dessous :
bun add @capgo/capacitor-data-storage-sqlitebunx cap syncImporter
Section intitulée « Importer »import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';API Vue d'ensemble
Section intitulée « API Vue d'ensemble »openStore
Section intitulée « ouvrirMagasin »Ouvrir un magasin
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.openStore({} as capOpenStorageOptions);closeStore
Section intitulée « fermerMagasin »Fermer le magasin
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.closeStore({} as capStorageOptions);isStoreOpen
Section intitulée “isStoreOpen”Vérifiez si le magasin est ouvert
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreOpen({} as capStorageOptions);isStoreExists
Section intitulée “isStoreExists”Vérifiez si le magasin existe
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreExists({} as capStorageOptions);deleteStore
Section intitulée “deleteStore”Supprimer un magasin
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteStore({} as capOpenStorageOptions);setTable
Section intitulée “setTable”Définir ou ajouter une table à un magasin existant
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.setTable({} as capTableStorageOptions);Stockez une donnée avec une clé et une valeur données
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.set({} as capDataStorageOptions);Récupérez une valeur de données pour une clé donnée
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.get({} as capDataStorageOptions);Supprimez une donnée avec une clé donnée
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.remove({} as capDataStorageOptions);Videz le Magasin de Données (supprimez toutes les clés)
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.clear();Vérifiez si une clé de données existe
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.iskey({} as capDataStorageOptions);Obtenez la liste des clés de données
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.keys();Obtenez la liste des valeurs de données
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.values();filtervalues
Section intitulée “filtervalues”Obtenez la liste des valeurs de données pour les clés de filtre
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.filtervalues({} as capFilterStorageOptions);keysvalues
Section intitulée « clésvaleur »Obtenir la liste des paires clé/valeur de données
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.keysvalues();Vérifier si une table existe
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isTable({} as capTableStorageOptions);Obtenir la liste des tables pour le magasin actuel
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.tables();deleteTable
Section intitulée « deleteTable »Supprimer une table
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteTable({} as capTableStorageOptions);importFromJson
Section intitulée “importFromJson”Importer une base de données à partir d'un fichier JSON
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.importFromJson({} as capStoreImportOptions);isJsonValid
Section intitulée “isJsonValid”Vérifier la validité d'un objet JSON
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isJsonValid({} as capStoreImportOptions);exportToJson
Section intitulée “exportToJson”Exporter la base de données donnée sous forme de fichier JSON
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.exportToJson();Référence de type
Section intitulée “Référence de type”capOpenStorageOptions
Section intitulée « 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
Section intitulée « capStorageOptions »export interface capStorageOptions { /** * The storage name */ database: string;}capDataStorageResult
Section intitulée « capDataStorageResult »export interface capDataStorageResult { /** * result set to true when successful else false */ result?: boolean; /** * a returned message */ message?: string;}capTableStorageOptions
Section intitulée « capTableStorageOptions »export interface capTableStorageOptions { /** * The storage table name */ table: string;}capDataStorageOptions
Section intitulée « capDataStorageOptions »export interface capDataStorageOptions { /** * The data name */ key: string; /** * The data value when required */ value?: string;}capValueResult
Section intitulée « capValueResult »export interface capValueResult { /** * the data value for a given data key */ value: string;}capKeysResult
Section intitulée « capKeysResult »export interface capKeysResult { /** * the data key list as an Array */ keys: string[];}capValuesResult
Section intitulée « capValuesResult »export interface capValuesResult { /** * the data values list as an Array */ values: string[];}capFilterStorageOptions
Section intitulée « 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
Section intitulée « capKeysValuesResult »export interface capKeysValuesResult { /** * the data keys/values list as an Array of {key:string,value:string} */ keysvalues: any[];}capTablesResult
Section intitulée « capTablesResult »export interface capTablesResult { /** * the tables list as an Array */ tables: string[];}capStoreImportOptions
Section intitulée « capStoreImportOptions »export interface capStoreImportOptions { /** * Set the JSON object to import * */ jsonstring?: string;}Source Of Truth
Section intitulée « Source Of Truth »Cette page est générée à partir du plugin’s src/definitions.ts. Re-run la synchronisation lorsque le public API change en amont.
Continuez de la page d'accueil Getting Started
Section intitulée « Continuez de la page d'accueil Getting Started »Si vous utilisez Getting Started pour planifier le stockage et la gestion des fichiers, connectez-l’avec Utilisez @capgo/capacitor-data-storage-sqlite pour la capacité native dans Utilisez @capgo/capacitor-data-storage-sqlite, @capgo/capacitor-data-storage-sqlite pour les détails d'implémentation dans @capgo/capacitor-data-storage-sqlite, @capgo/capacitor-fichier pour les détails d'implémentation dans @capgo/capacitor-fichier, En utilisant @capgo/capacitor-fichier pour la capacité native en utilisant En @capgo/capacitor-fichier, et @capgo/capacitor-téléchargeur pour les détails d'implémentation dans @capgo/capacitor-téléchargeur.