feat: enhance API and query handling with Redis caching; add QueryGuard for query validation; refactor services to utilize RedisClient for improved performance
This commit is contained in:
@ -10,33 +10,33 @@ import * as path from "path";
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const node = await createDatabaseNode("localhost", 3306, "root", "root");
|
||||
// const node = await createDatabaseNode("localhost", 3306, "root", "root");
|
||||
|
||||
console.log("Database node created:", node);
|
||||
// console.log("Database node created:", node);
|
||||
|
||||
const project = await createProject("Test Project");
|
||||
// const project = await createProject("Test Project");
|
||||
|
||||
console.log("Project created:", project);
|
||||
// console.log("Project created:", project);
|
||||
|
||||
const db = await createDatabase(project.id, node.id);
|
||||
// const db = await createDatabase(project.id, node.id);
|
||||
|
||||
console.log("Database created:", db);
|
||||
// console.log("Database created:", db);
|
||||
|
||||
const migration = await createMigration(
|
||||
db.id,
|
||||
"CREATE TABLE `test` (id INT AUTO_INCREMENT PRIMARY KEY, col1 VARCHAR(255))",
|
||||
"DROP TABLE `test`"
|
||||
);
|
||||
// const migration = await createMigration(
|
||||
// db.id,
|
||||
// "CREATE TABLE `test` (id INT AUTO_INCREMENT PRIMARY KEY, col1 VARCHAR(255))",
|
||||
// "DROP TABLE `test`"
|
||||
// );
|
||||
|
||||
console.log("Migration created:", migration);
|
||||
// console.log("Migration created:", migration);
|
||||
|
||||
const migrationResult = await databaseMigrationUp(db.id);
|
||||
// const migrationResult = await databaseMigrationUp(db.id);
|
||||
|
||||
console.log("Migrations applied:", migrationResult);
|
||||
// console.log("Migrations applied:", migrationResult);
|
||||
|
||||
const payloadPath = path.join(__dirname, "case1-payload.js");
|
||||
const query = await createQuery(
|
||||
project,
|
||||
{ token: "04c38f93-f2fb-4d2c-a8e2-791effa35239" },
|
||||
fs.readFileSync(payloadPath, { encoding: "utf-8" })
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user