commandorm
v1.2.5
Published
ORM/QueryBuilder for PostgreSQL and CSV
Readme
CommandORM: An ORM/QueryBuilder For PostgreSQL And CSV
CommandORM is a lightweight module that allows you to execute direct PostgreSQL commands within a JavaScript environment. It also features a Query Builder for efficiently retrieving, writing, updating, and deleting data from CSV files.
Code Example
Below is an exmple of how to use the CommandORM.
// The postgresSQL ORM/QueryBuilder and CSV QueryBuilder
import { Model, CSVDatabase } from 'commandORM';
const config = {
user: 'user-name',
host: 'your-host',
database: 'your-db-name',
password: 'your-password',
port: 'your-port',
allowExitOnIdle: true,
// this way you don't have to wait for program to finish after the query
_schemaName: 'your-schema-name',
};
const model = new Model(config);
const sqlTableContents = await model.table('your-table-name').select().get();
// Closes all connections to postgreSQL
await model.close();
// CommandORM already has a folder with a CSV file inside
const db = new CSVDatabase('./commandORM/DB')
const csvContents = await db.table('index.csv').select().get();Installation
Need to have Node.js installed.
- Clone the repo
git clone https://github.com/verg87/commandORM.git - Install dependencies
npm install
Or you can just install it with npm.
npm i commandormTesting
This project uses jest for testing. To run tests use:
npm testCoverage
CommandORM has almost 100% test coverage

To create a coverage report, use this command:
npm test --coverage