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

@nyffels/mynodeorm

Package Overview
Dependencies
Maintainers
0
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nyffels/mynodeorm - npm Package Compare versions

Comparing version 1.0.0-alpha110 to 1.0.0-alpha111

18

dist/logic/mysql.logic.js

@@ -12,8 +12,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import mysql from 'mysql2/promise';
import { DeclarationStorage } from "../models/index.js";
export function setConnection() {
return __awaiter(this, void 0, void 0, function* () {
var _a;
if (!isNil(global.connection)) {
return;
}
global.connection = yield mysql.createConnection(process.env["Database"]);
const declaration = DeclarationStorage.get().declaration;
if (!declaration) {
throw new Error("No declaration found.");
}
const options = declaration.getConnectionOptions();
global.connection = yield mysql.createConnection({
host: options.host,
user: options.user,
database: options.database,
password: options.password,
port: (_a = options.port) !== null && _a !== void 0 ? _a : 3306,
timezone: 'Z',
supportBigNumbers: true,
bigNumberStrings: false,
});
});

@@ -20,0 +36,0 @@ }

@@ -21,6 +21,8 @@ import { propertyType } from "./property.models.js";

private _tables;
private _options;
get name(): string;
get tables(): DatabaseTable<any>[];
getConnectionOptions(): ConnectionOptions;
getTable<T = any>(name: string): DatabaseTable<T>;
constructor();
constructor(options: ConnectionOptions);
declareTable<T>(classObject: object, dbTableName?: string | null): DatabaseTable<T>;

@@ -86,2 +88,9 @@ }

}
export interface ConnectionOptions {
host: string;
user: string;
database: string;
password: string;
port?: number;
}
export {};

@@ -55,2 +55,5 @@ import { Factory } from "./factory.models.js";

}
getConnectionOptions() {
return this._options;
}
getTable(name) {

@@ -63,5 +66,6 @@ const table = this._tables.find(t => t.name === name);

}
constructor( /* name: string = "default" // We currently restrict the library to one connection. the groundwork for multi declarations is laid, but not implemented compeletely. */) {
constructor(options /* name: string = "default" // We currently restrict the library to one connection. the groundwork for multi declarations is laid, but not implemented compeletely. */) {
this._tables = [];
this._name = "default"; // name => See text above;
this._options = options;
DeclarationStorage.add(this);

@@ -68,0 +72,0 @@ }

2

package.json
{
"name": "@nyffels/mynodeorm",
"version": "1.0.0-alpha110",
"version": "1.0.0-alpha111",
"description": "A full-fledged ORM framework for NodeJS and MySQL with develop friendly code aimed to handle database migrations, MySQL Query builder / helper and property mapping.",

@@ -5,0 +5,0 @@ "private": false,

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