Skip to main content

A great option for creating SQL tables in yaml format.

Project description

GitHub top language GitHub GitHub repo size

It's a script to transform yaml file to SQL-code.

We worked as a migration to the database. You can create your migration through of migration.yaml file inside migrations folder and run the script for migrate.

Install

You can install the script through of pip command:

pip intall flore

Usage

Run the command flore init to create migration folder with the follow files:

  • migration.yaml
  • seed.yaml
  • config.yaml

Configuration

For configuration the migration, open config.yaml file and set information:

dialect: 'pg'
host: 'localhost'
port: 5432
username: 'postgres'
password: 'docker'
database: 'flore'

dialect is a name of the database service, for example: mysql, pg => postgres. Currently support postgres only. Now, you can set username, password, database, port and host for you database.

Migration

For create migration you set in migration.yaml the following information:

tables:
  users:
    name:
      - varchar:120
      - required
    email:
      - varchar:84
      - required
      - unique
    password:
      - varchar:255
    is_admin:
      - boolean
      - default false
  products:
    price:
      - float

Run with the follow command

flore run

To migrate tables your postgres database.

Screenshot

migration.yaml SQL1 SQL2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flore-0.0.2.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

flore-0.0.2-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page