From 52ae118759fdcb1ffd95e9a0cbd55e977216b080 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 12 May 2025 09:56:33 +0200 Subject: [PATCH 1/2] Remove Drop statements from correctBugInCapacitorQueryRunner script docs --- docs/TypeORM-Usage-From-5.6.0.md | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/TypeORM-Usage-From-5.6.0.md b/docs/TypeORM-Usage-From-5.6.0.md index 977c04c4..21a75645 100644 --- a/docs/TypeORM-Usage-From-5.6.0.md +++ b/docs/TypeORM-Usage-From-5.6.0.md @@ -227,20 +227,8 @@ const correctBugInCapacitorQueryRunner = (file) => { console.warn(`${isModifiedKey} found. Package probably fixed.`); return; } - - const index = data.indexOf(`"DROP",`) - if (index === -1) { - console.warn('Line not found. Package probably fixed.'); - return; - } - - var result = data.replace( - ` "DROP",`, - ` "DROP", - "PRAGMA"` - - ); - result = result.replace( + + let result = data.replace( 'else if (["INSERT", "UPDATE", "DELETE", "PRAGMA"].indexOf(command) !== -1) {', 'else if (["INSERT", "UPDATE", "DELETE"].indexOf(command) !== -1) {' ); @@ -279,7 +267,7 @@ const correctBugInCapacitorDriver = (file) => { return; } - var result = data.replace( + let result = data.replace( 'await connection.run(`PRAGMA foreign_keys = ON`);', 'await connection.execute(`PRAGMA foreign_keys = ON`, false);' ); @@ -296,7 +284,7 @@ const correctBugInCapacitorDriver = (file) => { }); }); } else { - utils.warn(`Couldn't find file ${file}`); + console.log(`Couldn't find file ${file}`); } } From 2076007b3e3a2c2b8cd1d0e505dda4d506371628 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 May 2025 10:34:42 +0200 Subject: [PATCH 2/2] Add mention of working TypeORM versions for Capacitor bug Clarified the range of TypeORM versions affected by the Capacitor driver bug. This ensures accurate guidance for developers using versions between 0.3.18 and 0.3.24. --- docs/TypeORM-Usage-From-5.6.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/TypeORM-Usage-From-5.6.0.md b/docs/TypeORM-Usage-From-5.6.0.md index 21a75645..be95d59e 100644 --- a/docs/TypeORM-Usage-From-5.6.0.md +++ b/docs/TypeORM-Usage-From-5.6.0.md @@ -200,7 +200,7 @@ export const getCountOfElements = (async (connection: DataSource, entity:any): ## Correcting a Bug in the TypeOrm Capacitor Driver - - the bug is referenced "PRAGMA must run under query method in Capacitor sqlite #10687" in the typeorm/issues and it is for `typeorm release > 3.0.18`. + - the bug is referenced "PRAGMA must run under query method in Capacitor sqlite #10687" in the typeorm/issues and it is for `typeorm release > 0.3.18 and < 0.3.24`. - create a `scripts` directory at the root of the App.