0.12.0 • Published 5 years ago
lucidy v0.12.0
Lucidy
Lucidy is a Typescript ORM created on top of Lucid ORM (AdonisJS V5)
Why
AdonisJS is a great framework and it has one of the best ORM. But it works only in the AdonisJS framework.
Installation
npm install lucidyUsage
Your project
Add this line at the very main file of your app, before any code
import 'lucidy';Customization
Add a file called lucidyconfig in the root of your project with the following options:
// lucidyconfig.js
module.exports = {
directories: {
models: 'my-custom-models-folder', // default -> models
seeders: 'my-custom-seeders-folder', // default -> database/seeders
migrations: 'my-custom-migrations-folder', // default -> database/migrations
},
database: {
connection: 'pg',
connections: {
pg: {
client: 'pg',
connection: {
host: '127.0.0.1',
port: 5432,
user: 'user',
password: 'pass',
database: 'my-database',
},
},
},
},
};CMD
You can use all commands related to Lucid. Run this to see all options:
npx ace --helpTypescript
If your code editor does not recognize the Lucid imports, add the Lucid types in you tsconfig.json:
"types": ["@adonisjs/lucid"]Documentation
You can follow this documentation