INNER CODE UNIT · JavaScript

initSettingTable

currycan/HaTickets · desktop/src/sql/index.js:72

export const initSettingTable = async () => {
    await initDb();
    await db.execute(
        `CREATE TABLE IF NOT EXISTS ${settingTableName} (proxy TEXT, appid_list TEXT, appid TEXT NOT NULL)`
    );
};

// 添加逻辑 - parameterized queries
export const insert = async (tableName, params) => {
    if (!isAllowedTable(tableName)) {
        throw new Error(`Table "${tableName}" is not allowed`);
    }

    const keys = Object.keys(params);
    if (keys.some(k => !isValidColumnName(k))) {
        throw new Error("Invalid column name detected");
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…