masterrecord 0.3.61 → 0.3.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SQLLiteEngine.js CHANGED
@@ -1224,7 +1224,10 @@ class SQLLiteEngine {
1224
1224
  return mainString;;
1225
1225
  }
1226
1226
 
1227
- _execute(query){
1227
+ _execute(query, params){
1228
+ if (params && params.length > 0) {
1229
+ return this._executeWithParams(query, params);
1230
+ }
1228
1231
  if (process.env.LOG_SQL === 'true' || process.env.NODE_ENV !== 'production') {
1229
1232
  console.debug("[SQL]", query);
1230
1233
  }
package/context.js CHANGED
@@ -1824,20 +1824,25 @@ class context {
1824
1824
 
1825
1825
 
1826
1826
  /**
1827
- * Execute a raw SQL query
1827
+ * Execute a raw SQL query, optionally with parameterized values
1828
1828
  *
1829
1829
  * @param {string} query - SQL query to execute
1830
+ * @param {Array} [params] - Optional array of parameter values for placeholders
1830
1831
  *
1831
1832
  * @example
1832
1833
  * context._execute('CREATE INDEX idx_user_email ON User(email)');
1834
+ * context._execute('UPDATE User SET name = ? WHERE id = ?', ['Alice', 1]);
1833
1835
  */
1834
- _execute(query) {
1836
+ _execute(query, params) {
1835
1837
  if (!this._SQLEngine) {
1836
1838
  throw new DatabaseConnectionError(
1837
1839
  'Cannot execute query: database engine not initialized. Ensure you have awaited env() before running queries.',
1838
1840
  this.isMySQL ? 'MySQL' : this.isPostgres ? 'PostgreSQL' : 'SQLite'
1839
1841
  );
1840
1842
  }
1843
+ if (params && params.length > 0) {
1844
+ return this._SQLEngine._execute(query, params);
1845
+ }
1841
1846
  return this._SQLEngine._execute(query);
1842
1847
  }
1843
1848
 
package/mySQLEngine.js CHANGED
@@ -802,8 +802,8 @@ class MySQLEngine {
802
802
  * Execute raw SQL (DDL statements like CREATE TABLE, ALTER TABLE, etc.)
803
803
  * Used by migration schema for non-parameterized DDL queries.
804
804
  */
805
- _execute(query) {
806
- return this._runWithParams(query, []);
805
+ _execute(query, params) {
806
+ return this._runWithParams(query, params || []);
807
807
  }
808
808
 
809
809
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "masterrecord",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "description": "An Object-relational mapping for the Master framework. Master Record connects classes to relational database tables to establish a database with almost zero-configuration ",
5
5
  "main": "MasterRecord.js",
6
6
  "bin": {
package/postgresEngine.js CHANGED
@@ -754,8 +754,8 @@ class postgresEngine {
754
754
  * Execute raw SQL (DDL statements like CREATE TABLE, ALTER TABLE, etc.)
755
755
  * Used by migration schema for non-parameterized DDL queries.
756
756
  */
757
- _execute(query) {
758
- return this._runWithParams(query, []);
757
+ _execute(query, params) {
758
+ return this._runWithParams(query, params || []);
759
759
  }
760
760
 
761
761
  async _runWithParams(query, params = []) {