Metadata-Version: 2.1
Name: flore
Version: 0.0.1
Summary: A great option for creating SQL tables in yaml format.
Home-page: https://github.com/marcuxyz/flore-sql
License: MIT
Keywords: python,flore-sql,yaml to sql,yamlsql,transpile sql,sql tests,migrations,migrate,orm
Author: Marcus Pereira
Author-email: hi@marcuspereira.xyz
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyYAML (>=5.3.1,<6.0.0)
Requires-Dist: click (>=7.1.2,<8.0.0)
Requires-Dist: psycopg2-binary (>=2.8.6,<3.0.0)
Project-URL: Repository, https://github.com/marcuxyz/flore-sql
Description-Content-Type: text/markdown

![GitHub top language](https://img.shields.io/github/languages/top/marcuxyz/flore-sql) ![GitHub](https://img.shields.io/github/license/marcuxyz/flore-sql) ![GitHub repo size](https://img.shields.io/github/repo-size/marcuxyz/flore-sql)

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:

```bash
pip intall flore-sql
```

# 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:

```yaml
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:

```yaml
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

```yaml
flore run
```

To migrate tables your postgres database.
