New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

drizzle-orm

Package Overview
Dependencies
Maintainers
3
Versions
1003
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drizzle-orm - npm Package Compare versions

Comparing version 0.12.0-beta.22 to 0.12.0-beta.23

4

operations.d.ts

@@ -19,1 +19,5 @@ import { AnyColumn } from './column';

}[];
export declare type SelectFieldsOrderedV2 = {
path: string[];
field: AnyColumn | SQL | SQLResponse;
}[];

6

package.json
{
"name": "drizzle-orm",
"version": "0.12.0-beta.22",
"version": "0.12.0-beta.23",
"description": "Drizzle ORM package for SQL databases",

@@ -53,6 +53,6 @@ "main": "index.js",

"pack": "cp ../README.md package.json dist/ && (cd dist && pnpm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz",
"publish:beta": "npm publish package.tgz --tag beta",
"release:beta": "pnpm build && pnpm version prerelease && pnpm run pack && pnpm publish:beta",
"release": "pnpm build && pnpm run pack && pnpm run publish",
"release:beta": "pnpm build && pnpm run pack && pnpm run publish --tag beta",
"build:int": "pnpm build && pnpm run pack"
}
}

@@ -182,5 +182,3 @@ "use strict";

}
else {
return p;
}
return p;
});

@@ -187,0 +185,0 @@ }

@@ -1,3 +0,4 @@

import { SelectFieldsOrdered } from './operations';
import { SelectFieldsOrdered, SelectFieldsOrderedV2 } from './operations';
export declare function mapResultRow<TResult extends Record<string, unknown>>(columns: SelectFieldsOrdered, row: unknown[], joinsNotNullable?: Record<string, boolean>): TResult;
export declare function mapResultRowV2<TResult extends Record<string, unknown>>(columns: SelectFieldsOrderedV2, row: unknown[], joinsNotNullable?: Record<string, boolean>): TResult;
export declare type OneOrMany<T> = T | T[];

@@ -4,0 +5,0 @@ export declare type Update<T, TUpdate> = Simplify<Omit<T, keyof TUpdate> & TUpdate>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapResultRow = void 0;
exports.mapResultRowV2 = exports.mapResultRow = void 0;
const column_1 = require("./column");

@@ -42,2 +42,44 @@ const sql_1 = require("./sql");

exports.mapResultRow = mapResultRow;
function mapResultRowV2(columns, row, joinsNotNullable) {
const result = columns.reduce((result, { path, field }, columnIndex) => {
let decoder;
if (field instanceof column_1.Column) {
decoder = field;
}
else if (field instanceof sql_1.SQL) {
decoder = sql_1.noopDecoder;
}
else {
decoder = field.decoder;
}
let node = result;
path.forEach((pathChunk, pathChunkIndex) => {
if (pathChunkIndex < path.length - 1) {
if (!(pathChunk in node)) {
node[pathChunk] = {};
}
node = node[pathChunk];
}
else {
const rawValue = row[columnIndex];
node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);
}
});
return result;
}, {});
if (!joinsNotNullable) {
return result;
}
// If all fields in a table are null, return null for the table
return Object.fromEntries(Object.entries(result).map(([tableName, tableResult]) => {
if (!joinsNotNullable[tableName]) {
const hasNotNull = Object.values(tableResult).some((value) => value !== null);
if (!hasNotNull) {
return [tableName, null];
}
}
return [tableName, tableResult];
}));
}
exports.mapResultRowV2 = mapResultRowV2;
//# sourceMappingURL=utils.js.map

Sorry, the diff of this file is not supported yet

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