dsql 0.0.9+8 copy "dsql: ^0.0.9+8" to clipboard
dsql: ^0.0.9+8 copied to clipboard

Dart SQL library for generating .dart files from .sql files

DSQL ORM #

An Experimental Dart ORM or Something Similar

Installation
dart pub global activate dsql
and add dsql to your pubspec.yaml
dependencies:
  dsql: ^0.0.9+8
In the root, create a folder called migrations with your .sql file, like spring boot for example.
-- ./migrations/V1__create_users_table.sql

-- Entity => User
CREATE TABLE users (
  id SERIAL PRIMARY KEY DEFAULT nextval('users_id_seq'),
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) NOT NULL UNIQUE,
  password VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Then you can run the migrations command with the following command
dsql --migrate or -m
dsql -g -o /path/to/output
You will need to provide the database url to migrate and generate DSQL classes
DSQL CLI - Dart SQL Schema Generator
Enter your postgresSQL database URL: postgresql://user:password@host:port/database
Next steps:
- Add more SQL types (currently only VARCHAR, TEXT, UUID, BOOLEAN, INTEGER, DOUBLE, TIMESTAMP are supported)
- Add relationship between entities
- Add others drivers like MySQL, MSSQL, SQLite!
Twitter: @tihraguinho
4
likes
140
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

Dart SQL library for generating .dart files from .sql files

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

args, path, postgres

More

Packages that depend on dsql