2025-07-17 15:44:34 +08:00

38 lines
1.0 KiB
TypeScript

// import * as SQLite from 'expo-sqlite';
// const db = SQLite.openDatabase('upload_status.db');
// // 初始化表
// export function initUploadTable() {
// db.transaction(tx => {
// tx.executeSql(
// `CREATE TABLE IF NOT EXISTS uploaded_files (
// uri TEXT PRIMARY KEY NOT NULL
// );`
// );
// });
// }
// // 检查文件是否已上传
// export function isFileUploaded(uri: string): Promise<boolean> {
// return new Promise(resolve => {
// db.transaction(tx => {
// tx.executeSql(
// 'SELECT uri FROM uploaded_files WHERE uri = ?;',
// [uri],
// (_, { rows }) => resolve(rows.length > 0)
// );
// });
// });
// }
// // 记录文件已上传
// export function markFileAsUploaded(uri: string) {
// db.transaction(tx => {
// tx.executeSql(
// 'INSERT OR IGNORE INTO uploaded_files (uri) VALUES (?);',
// [uri]
// );
// });
// }