typeorm / typeorm

ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
http://typeorm.io
MIT License
34.03k stars 6.27k forks source link

Typeorm shell #5417

Open clovis1122 opened 4 years ago

clovis1122 commented 4 years ago

Issue type:

[ ] question [ ] bug report [x] feature request [ ] documentation issue

It would be tremendously helpful if TypeORM included a shell as part of the CLI commands, just like Laravel's artisan and Django's shell command. It would load ts-node and TypeORM with an already established connection and all the entities/repositories loaded.

The command would be: typeorm shell.

Right now whenever I need to test something quickly I open ts-node and do something like this:

import { createConnection, getConnectionOptions } from 'typeorm';

var con;
(async() => {
    const connectionOptions = await getConnectionOptions();
    con = await createConnection(connectionOptions);
})();
const userRep = con.getRepository('User') ; // The repository I want to use.
feather-jamaica commented 4 years ago

+1 this would be wonderful!

AugustinVignet commented 4 years ago

+1 this would be really great

bolerap commented 3 years ago

+1 great feature

cherryramatisdev commented 2 years ago

+1 this would be awesome