bug: exportToJson: Error get tables 'Full' failed : Query result not well formatted
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, sqlite, swift
調査の方向性
sqliteLoader.js の exportToJson ラッパーから始め、提供された users スキーマを使用して iOS で失敗を再現します。createSyncTable の設定とプラグインの iOS エクスポートパスを確認し、Full クエリの結果が拒否される理由を調べます。このデータベースのテーブルを JSON に正常にエクスポートできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Plugin version:
7.0.1
Platform(s):
iOS
Current behavior:
exportToJson: Error get tables 'Full' failed : Query result not well formatted
Expected behavior:
Succeed in exporting tables to JSON
Steps to reproduce:
async exportToJson(mode = 'full') {
console.log('[ sqliteLoader.js ] Exporting database to JSON...');
return await sqlite.exportToJson({
database: DB_NAME,
jsonexportmode: mode
});
},
Related code:
Sample table:
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
lastName TEXT,
phoneNumber TEXT,
email TEXT,
sobrietyDate TEXT,
homeGroups TEXT,
preferences TEXT,
privacySettings TEXT,
notificationSettings TEXT, -- JSON string for notification preferences
createdAt TEXT DEFAULT CURRENT_TIMESTAMP,
updatedAt TEXT DEFAULT CURRENT_TIMESTAMP,
sql_deleted BOOLEAN DEFAULT 0 CHECK (sql_deleted IN (0, 1)),
last_modified INTEGER DEFAULT (strftime('%s', 'now'))
)
import { CapacitorSQLite } from '@capacitor-community/sqlite';
// Default database name for consistency
const DB_NAME = 'tracker.db';
/**
* Initialize SQLite database
* @returns {Promise<object>} Database connection object
*/
export default async function initSQLiteDatabase() {
console.log('[ sqliteLoader.js:14 ] Initializing SQLite database via Capacitor...');
try {
const sqlite = CapacitorSQLite;
if (!sqlite) {
throw new Error('CapacitorSQLite plugin not found - this app requires SQLite for iOS');
}
console.log('[ sqliteLoader.js ] Found CapacitorSQLite plugin:', !!sqlite);
// Step 1: Create connection (check if already exists first)
try {
await sqlite.createConnection({
database: DB_NAME,
version: 1,
encrypted: false,
mode: 'no-encryption',
readonly: false
});
console.log('[ sqliteLoader.js:50 ] Database connection created');
} catch (connectionError) {
console.log('[ sqliteLoader.js:52 ] Connection may already exist:', connectionError.message);
}
// Step 2: Open the database
await sqlite.open({ database: DB_NAME, readonly: false });
console.log('[ sqliteLoader.js:56 ] Database opened successfully');
// Step 3: Create sync table (required for CapacitorSQLite export/import operations)
await sqlite.createSyncTable({ database: DB_NAME });
console.log('[ sqliteLoader.js:58 ] Sync table created successfully');
// Sync methods for iCloud integration
async exportToJson(mode = 'full') {
console.log('[ sqliteLoader.js ] Exporting database to JSON...');
return await sqlite.exportToJson({
database: DB_NAME,
jsonexportmode: mode
});
},
async importFromJson(jsonData) {
console.log('[ sqliteLoader.js ] Importing database from JSON...');
return await sqlite.importFromJson({
jsonstring: JSON.stringify(jsonData)
});
},
async setSyncDate(syncDate) {
console.log('[ sqliteLoader.js ] Setting sync date...');
return await sqlite.setSyncDate({
database: DB_NAME,
syncdate: syncDate
});
},
async deleteExportedRows() {
console.log('[ sqliteLoader.js ] Deleting exported rows...');
return await sqlite.deleteExportedRows({
database: DB_NAME
});
}
};
} catch (error) {
console.error('[ sqliteLoader.js ] Database initialization failed:', error);
throw error;
}
}
Other information:
I have read through https://github.com/capacitor-community/sqlite/issues/59 and it is long-closed, but I am having this problem repeatedly and cannot find a fix for it.
Capacitor doctor:
% npx cap doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.4.2
@capacitor/core: 7.4.2
@capacitor/android: 7.4.2
@capacitor/ios: 7.4.2
Installed Dependencies:
@capacitor/cli: 7.4.2
@capacitor/core: 7.4.2
@capacitor/android: 7.4.2
@capacitor/ios: 7.4.2
[success] iOS looking great! 👌
[error] gradlew file is missing in android
AndroidManifest.xml is missing in app/src/main
Expected, since I'm not currently working on Android.
- 主要言語
- Swift
- スター
- 663
- フォーク
- 159
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
capacitor-community/sqlite のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
capacitor-community/sqlite#700 · コメント 1 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
capacitor-community/sqlite#693 · リアクション 7 件 ·
-
bug/fix needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
capacitor-community/sqlite#690 ·
-
feature needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
capacitor-community/sqlite#689 ·
-
bug/fix needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
capacitor-community/sqlite#685 ·
capacitor-community/sqlite の issue をすべて見る
似ている issue
-
area: agents area: cli bug difficulty:2 help wanted S3: minor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
manaflow-ai/cmux#15718 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mozilla-mobile/firefox-ios#35850 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
appandflow/stim#1941 ·
メンテナーはふだん 1 日以内に返信
-
product / avatars product / self-hosted product / storage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
appwrite/appwrite#13985 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信