Skip to content

vitassuper/flux-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Diesel CLI with --database-url

Install

cargo install diesel_cli --no-default-features --features "postgres"  # For PostgreSQL

Setup

diesel setup --database-url=postgres://username:password@localhost/database  # For PostgreSQL

Usage

Running Migrations

To apply pending migrations to your database, use the following command:

diesel migration run --database-url=postgres://username:password@localhost/database

Rolling Back Migrations

To rollback the last applied migration, use the following command:

diesel migration redo --database-url=postgres://username:password@localhost/database

Generating Models and Schema

Diesel can generate Rust code for your database schema and models. To generate the code, use:

diesel print-schema --database-url=postgres://username:password@localhost/database > src/schema.rs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published