시작하기
__CAPGO_KEEP_3__
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.
설치, 동기화 및 전체 소스 가이드를 한 번의 복사 가능한 명령어로 따라하세요.
설치, 동기화 및 전체 소스 가이드를 포함한 설치 단계와 마크다운 가이드를 복사할 수 있습니다.bun add @capgo/capacitor-data-storage-sqlitebunx cap syncimport { 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
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreOpen({} as capStorageOptions);isStoreExists
__CAPGO_KEEP_1____CAPGO_KEEP_3__
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreExists({} as capStorageOptions);deleteStore
__CAPGO_KEEP_4____CAPGO_KEEP_0__
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteStore({} as capOpenStorageOptions);setTable
__CAPGO_KEEP_5____CAPGO_KEEP_0__
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.setTable({} as capTableStorageOptions);set
‘set’ 섹션지정된 키와 값으로 데이터 저장
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.set({} as capDataStorageOptions);get
‘get’ 섹션지정된 데이터 키에 대한 데이터 값 가져오기
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.get({} as capDataStorageOptions);remove
‘remove’ 섹션지정된 키로 데이터 삭제
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.remove({} as capDataStorageOptions);clear
‘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
키/값 목록현재 데이터 키/값 pair 목록 가져오기
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
현재 스토어의 표 삭제__CAPGO_KEEP_0__
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
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. upstream에서 pubic API이 변경되었을 때 다시 싱크를 실행하세요.