Début de la mise en route
Copier 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.
Installer
Section intitulée “Installer”bun add @capgo/capacitor-data-storage-sqlitebunx cap syncImporter
Section intitulée « Import »import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';API Vue d'ensemble
Section intitulée « API Vue d'ensemble »openStore
Section intitulée « openStore »Ouvrir une boutique
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.openStore({} as capOpenStorageOptions);closeStore
Section intitulée « closeStore »Fermer la boutique
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.closeStore({} as capStorageOptions);isStoreOpen
Section intitulée « isStoreOpen »Vérifier si la boutique est ouverte
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 »Ajoutez ou mettez à jour une table dans un magasin existant
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.setTable({} as capTableStorageOptions);Stockez des données avec une clé et une valeur données
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.set({} as capDataStorageOptions);Récupérer une valeur de données pour une clé de données donnée
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.get({} as capDataStorageOptions);Supprimer une donnée avec une clé donnée
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.remove({} as capDataStorageOptions);Effacer le Magasin de données (supprimer toutes les clés)
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.clear();Vérifier 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 “valeursfiltrées”Obtenez la liste des valeurs de données pour les clés de filtres
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.filtervalues({} as capFilterStorageOptions);keysvalues
Section intitulée “clés/valeurs”Obtenez la liste des paires clé/valeur de données
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.keysvalues();isTable
Section intitulée “isTable”Vérifiez si une table existe
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isTable({} as capTableStorageOptions);Obtenez 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érifiez 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 d'objet JSON
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.exportToJson();Référence de type
Section intitulée “Type Reference”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 De Vérité
Section intitulée “Source De Vérité”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 Lancer votre projet
Titre de la section “Continuez de Lancer votre projet”Si vous utilisez Lancer votre projet pour planifier le stockage et la gestion des fichiers, connectez-le avec En utilisant @capgo/capacitor-stockage-de-données-sqlite pour la capacité native dans En utilisant @capgo/capacitor-stockage-de-données-sqlite, @capgo/capacitor-stockage-de-données-sqlite pour le détail d'implémentation dans @capgo/capacitor-stockage-de-données-sqlite, @capgo/capacitor-fichier pour le détail d'implémentation dans @capgo/capacitor-fichier, Utiliser @capgo/capacitor-fichier pour la capacité native dans Utiliser @capgo/capacitor-fichier, et @capgo/capacitor-téléchargeur pour le détail d'implémentation dans @capgo/capacitor-téléchargeur.