文件操作 - core.cjs
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/db0/connectors/libsql/core.cjs
编辑文件内容
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); module.exports = libSqlCoreConnector; function libSqlCoreConnector(opts) { function query(sql) { const client = opts.getClient(); return client.execute(sql); } return { name: opts.name || "libsql-core", dialect: "libsql", getInstance: async () => opts.getClient(), exec(sql) { return query(sql); }, prepare(sql) { const stmt = { _sql: sql, _params: [], bind(...params) { if (params.length > 0) { this._params = params; } return stmt; }, all(...params) { return query({ sql: this._sql, args: params || this._params }).then(r => r.rows); }, run(...params) { return query({ sql: this._sql, args: params || this._params }).then(r => ({ result: r, rows: r.rows })); }, get(...params) { return query({ sql: this._sql, args: params || this._params }).then(r => r.rows[0]); } }; return stmt; } }; }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件