New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@pencroff/typeorm-better-sqlite3

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pencroff/typeorm-better-sqlite3

better-sqlite3 driver for typeorm

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

typeorm-better-sqlite3

Github

Performant better-sqlite3 driver for Typeorm.

It's 10x or even 18x faster for some cases - link

Usage

import { Connection, createConnection } from 'typeorm';
import { OrmService } from '@pencroff/typeorm-better-sqlite3';

async function run() {
    const orm = new OrmService();
    const con = await createConnection();
    await orm.useConnection(con);
    const repo = orm.getRepo(SomeModel);
    const result: SomeModel[] = await repo.find({
      where: {
        fieldA: 'abd',
        fieldB: 123,
      },
    })
}

for more details please check example folder

Instalation notes

It requires building tools and Python 2 (should be >=2.6.0 <3.0.0).

Python 2 can be used from folder "C:\Python27\python.exe" (Not required to be in PATH)

Actually just run as Administrator (if you have any issue with compiling better-sqlite3):

npm install --global --production windows-build-tools

More details here.

Make sure to have sqlite3 package in your dev dependency. It requires for migrations.

Known issues

  • Import createConnection before OrmService. Like below:
import { createConnection } from 'typeorm';
import { OrmService } from '@pencroff/typeorm-better-sqlite3';

Keywords

typeorm

FAQs

Package last updated on 16 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts