시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
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.
설치
설치 제목Capgo의 AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 다음 프롬프트를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-data-storage-sqlite` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래 플랫폼별 지침을 따르세요:
bun 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({ database: 'database', table: 'table', encrypted: false, mode: 'encryption', autoVacuum: 'none',});closeStore
스토어 닫기 섹션스토어 닫기
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.closeStore({ database: 'database' });isStoreOpen
Section titled “store가 열려 있는가”스토어가 열려 있는지 확인하세요
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.isStoreOpen({ database: 'database' });console.log(result);isStoreExists
Section titled “스토어가 존재하는가”스토어가 존재하는지 확인하세요
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.isStoreExists({ database: 'database' });console.log(result);deleteStore
Section titled “스토어 삭제”스토어를 삭제하세요
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteStore({ database: 'database', table: 'table', encrypted: false, mode: 'encryption', autoVacuum: 'none',});setTable
Section titled “테이블 설정”기존 스토어에 테이블을 설정하거나 추가하세요
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.setTable({ table: 'table' });set
설정key-value pair를 저장합니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.set({ key: 'key-123' });key-value pair를 조회합니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.get({ key: 'key-123' });console.log(result);remove
제거key-value pair를 삭제합니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.remove({ key: 'key-123' });clear
클리어Data Store를 초기화합니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.clear();iskey
SQLite 데이터 저장 플러그인데이터 키가 존재하는지 확인합니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.iskey({ key: 'key-123' });console.log(result);keys
키데이터 키 목록을 가져옵니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.keys();console.log(result);values
values데이터 값 목록을 가져옵니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.values();console.log(result);filtervalues
필터값필터 키에 대한 데이터 값 목록을 가져옵니다.
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.filtervalues({ filter: 'filter' });console.log(result);keysvalues
Section titled “키-값”데이터 키/값 pair 목록 가져오기
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.keysvalues();console.log(result);isTable
Section titled “테이블 존재 여부”현재 저장소의 테이블 존재 여부 확인
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.isTable({ table: 'table' });console.log(result);tables
Section titled “테이블 목록”현재 저장소의 테이블 목록 가져오기
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.tables();console.log(result);deleteTable
Section titled “테이블 삭제”테이블 삭제
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteTable({ table: 'table' });importFromJson
importFromJsonJSON 데이터베이스를 가져오기
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.importFromJson({ jsonstring: 'jsonstring' });console.log(result);isJsonValid
JSON 유효성 검사JSON 객체의 유효성을 확인하세요
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.isJsonValid({ jsonstring: 'jsonstring' });console.log(result);exportToJson
exportToJsonJSON 객체로 데이터베이스를 내보내기
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
const result = await CapgoCapacitorDataStorageSqlite.exportToJson();console.log(result);타입 참조
타입 참조capOpenStorageOptions
capOpenStorageOptionsexport 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
capValuesResultexport interface capValuesResult { /** * the data values list as an Array */ values: string[];}capFilterStorageOptions
capFilterStorageOptionsexport interface capFilterStorageOptions { /** * The filter data for filtering keys * * ['%filter', 'filter', 'filter%'] for * [starts with filter, contains filter, ends with filter] */ filter: string;}capKeysValuesResult
capKeysValuesResultexport interface capKeysValuesResult { /** * the data keys/values list as an Array of {key:string,value:string} */ keysvalues: any[];}capTablesResult
capTablesResultexport interface capTablesResult { /** * the tables list as an Array */ tables: string[];}capStoreImportOptions
capStoreImportOptionsexport interface capStoreImportOptions { /** * Set the JSON object to import * */ jsonstring?: string;}실질적 출처
진실의 근원이 페이지는 플러그인의 src/definitions.tsRe-run the sync when the public API changes upstream.
Getting Started
Section titled “Getting Started”If you are using Capgo. Getting Started storage 및 파일 처리를 계획하고 연결하려면 @capgo/capacitor-SQLite 데이터 저장소 사용 for the native capability in Using @capgo/capacitor-data-storage-sqlite @capgo/capacitor-SQLite 데이터 저장소 for the implementation detail in @capgo/capacitor-data-storage-sqlite @capgo/capacitor-파일 @capgo/capacitor-파일의 구현 세부 정보를 위해 @capgo/capacitor-파일을 사용합니다. for native 기능을 사용하기 위해 @capgo/capacitor-파일을 사용합니다. @capgo/capacitor-업로더 @capgo/capacitor-업로더 구현 세부 사항에 대해.