Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pgtyped/query

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pgtyped/query - npm Package Compare versions

Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2

25

lib/tag.js

@@ -13,5 +13,22 @@ "use strict";

exports.PreparedQuery = exports.TaggedQuery = void 0;
const typescript_1 = require("./loader/typescript");
const preprocessor_sql_1 = require("./preprocessor-sql");
const preprocessor_ts_1 = require("./preprocessor-ts");
const preprocessor_sql_1 = require("./preprocessor-sql");
const typescript_1 = require("./loader/typescript");
/** Check for column modifier suffixes (exclamation and question marks). */
function isHintedColumn(columnName) {
const lastCharacter = columnName[columnName.length - 1];
return lastCharacter === '!' || lastCharacter === '?';
}
function mapQueryResultRows(rows) {
for (const row of rows) {
for (const columnName in row) {
if (isHintedColumn(columnName)) {
const newColumnNameWithoutSuffix = columnName.slice(0, -1);
row[newColumnNameWithoutSuffix] = row[columnName];
delete row[columnName];
}
}
}
return rows;
}
/* Used for SQL-in-TS */

@@ -24,3 +41,3 @@ class TaggedQuery {

const result = yield connection.query(processedQuery, bindings);
return result.rows;
return mapQueryResultRows(result.rows);
});

@@ -41,3 +58,3 @@ }

const result = yield connection.query(processedQuery, bindings);
return result.rows;
return mapQueryResultRows(result.rows);
});

@@ -44,0 +61,0 @@ }

6

package.json
{
"name": "@pgtyped/query",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"main": "lib/index.js",

@@ -28,3 +28,3 @@ "types": "lib/index.d.ts",

"dependencies": {
"@pgtyped/wire": "^1.0.0-alpha.1",
"@pgtyped/wire": "^1.0.0-alpha.2",
"@types/chalk": "^2.2.0",

@@ -42,3 +42,3 @@ "@types/debug": "^4.1.4",

},
"gitHead": "d790e9f04f0335fa0f836a7a909b5b4814f98dc0"
"gitHead": "44d1fa82638fa6d96dbd0f58b221d26a9d2fbd6f"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc