__CAPGO_KEEP_2__

시작하기

GitHub

설치

설치

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-sqlite
bunx cap sync

수입

수입
import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';

API 개요

API 개요

스토어 열기

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.openStore({} as capOpenStorageOptions);

스토어 닫기

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.closeStore({} as capStorageOptions);

스토어가 열려 있는지 확인하세요

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreOpen({} as capStorageOptions);

스토어가 존재하는지 확인하세요

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isStoreExists({} as capStorageOptions);

스토어 삭제

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.deleteStore({} as capOpenStorageOptions);

기존 스토어에 테이블을 설정하거나 추가하세요

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.setTable({} as capTableStorageOptions);

지정된 키와 값으로 데이터 저장

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.set({} as capDataStorageOptions);

지정된 데이터 키에 대한 데이터 값 가져오기

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.get({} as capDataStorageOptions);

지정된 키로 데이터 삭제

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.remove({} as capDataStorageOptions);

데이터 저장소 비우기 (모든 키 삭제)

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();

테이블이 존재하는지 확인

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isTable({} as capTableStorageOptions);

현재 저장소의 테이블 목록 가져오기

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);

JSON 객체의 유효성을 확인하세요

import { CapgoCapacitorDataStorageSqlite } from '@capgo/capacitor-data-storage-sqlite';
await CapgoCapacitorDataStorageSqlite.isJsonValid({} as capStoreImportOptions);

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;
}
export interface capKeysResult {
/**
* the data key list as an Array
*/
keys: string[];
}
export interface capValuesResult {
/**
* the data values list as an Array
*/
values: string[];
}
export interface capFilterStorageOptions {
/**
* The filter data for filtering keys
*
* ['%filter', 'filter', 'filter%'] for
* [starts with filter, contains filter, ends with filter]
*/
filter: string;
}
export interface capKeysValuesResult {
/**
* the data keys/values list as an Array of {key:string,value:string}
*/
keysvalues: any[];
}
export interface capTablesResult {
/**
* the tables list as an Array
*/
tables: string[];
}
export interface capStoreImportOptions {
/**
* Set the JSON object to import
*
*/
jsonstring?: string;
}

실제 데이터의 원천

실제 데이터의 원천 섹션

이 페이지는 플러그인의 src/definitions.ts. upstream의 공개 API이 변경되었을 때 다시 싱크를 실행하세요.

Getting Started에서 계속

Getting Started에서 계속 섹션

이 플러그인을 사용하는 경우 Getting Started 저장소와 파일 처리를 계획하고 연결하려면 Using @capgo/capacitor-data-storage-sqlite Using @capgo/capacitor-data-storage-sqlite @capgo/capacitor-data-storage-sqlite for the implementation detail in @capgo/capacitor-data-storage-sqlite, @capgo/capacitor-file for the implementation detail in @capgo/capacitor-file, Using @capgo/capacitor-file for the native capability in Using @capgo/capacitor-file, and @capgo/capacitor-uploader for the implementation detail in @capgo/capacitor-uploader.