refactor(db): improve type safety in migration system
- Replace any[] with SqlValue[] type for SQL parameters in runMigrations - Update import to use QueryExecResult from interfaces/database - Add proper typing for SQL parameter values (string | number | null | Uint8Array) This change improves type safety and helps catch potential SQL parameter type mismatches at compile time, reducing the risk of runtime errors or data corruption.
This commit is contained in:
@@ -355,7 +355,7 @@ export default class Help extends Vue {
|
||||
|
||||
// for SQL operations
|
||||
sqlQuery = "";
|
||||
sqlResult: any = null;
|
||||
sqlResult: unknown = null;
|
||||
|
||||
cryptoLib = cryptoLib;
|
||||
|
||||
@@ -542,9 +542,9 @@ export default class Help extends Vue {
|
||||
} else {
|
||||
this.sqlResult = await databaseService.run(this.sqlQuery);
|
||||
}
|
||||
console.log("SQL Result:", this.sqlResult);
|
||||
logger.log("SQL Result:", this.sqlResult);
|
||||
} catch (error) {
|
||||
console.error("SQL Error:", error);
|
||||
logger.error("SQL Error:", error);
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
|
||||
Reference in New Issue
Block a user