Yedidyar / remult-cli

⛔Deprecated⛔ Use Remult Kit instead remult-cli is a command-line tool designed to simplify the process of generating Remult entities from a PostgreSQL database.
https://www.npmjs.com/package/remult-cli
MIT License
12 stars 2 forks source link
cli nodejs postgresql remult

Remult CLI

GitHub license

⛔Deprecated⛔

Use Remult Kit instead.

Docs


remult-cli is a command-line tool designed to simplify the process of generating Remult entities from a PostgreSQL database.

Inspired by prisma db pull, this tool streamlines the creation of Remult entities, making database integration smoother and more efficient.

Usage

Basic Usage

Generate Remult entities using the default settings:

npx remult-cli pull

Advanced Usage

For more advanced usage, you can utilize the --help flag to explore the available options:

npx remult-cli --help

Examples

# All entities from two schemas:
npx remult-cli pull --schemas auth public

# All entities from all schemas:
npx remult-cli pull --schemas '*'

Options

Environmental Variables

Alternatively, you can utilize a .env file to set configuration values. Example:

DATABASE_URL=postgres://user:pass@host:port/db-name
TABLE_PROPS=allowApiCrud: (r) => r?.authenticated() ?? false
OUTPUT=./fancy/place
DEFAULT_ORDER_BY = "order,name,nom,username"
CUSTOM_DECORATORS = '{"@Fields.string":"@KitFields.string#@kitql/remult","@Fields.dateOnly":"@KitFields.dateOnly#@kitql/remult"}'

After setting up your .env file, run the following command:

npx remult-cli pull

Development

  1. Clone the repository:
git clone https://github.com/Yedidyar/remult-cli.git
  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm dev
  1. Begin development:
pnpm start
  1. Run CI locally with 🌍 earthly 🌍
    • Install earthly for yours OS (you can see there yours OS pre-requisites)
    • Run earthly -P +all (you can also add the --interactive flag for debugging)

Contribution

We welcome contributions from the community! If you find any issues or have ideas for enhancements, please submit bug reports, feature requests, or pull requests through our GitHub repository.

License

remult-cli is licensed under the MIT License.