Skip to content

Commit

Permalink
added dialects to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wendy-aw committed May 28, 2024
1 parent cc27b1f commit 608e181
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ export DBPORT=5432
```

#### Snowflake
To setup the data in snowflake, you would need to have the snowflake cli installed ([instructions](https://docs.snowflake.com/en/user-guide/snowsql-install-config)), and have your credentials configured as per the [docs](https://docs.snowflake.com/en/user-guide/snowsql-config). You can then run the following command to setup the data:
To set up the data in snowflake, you would need to have the snowflake cli installed ([instructions](https://docs.snowflake.com/en/user-guide/snowsql-install-config)), and have your credentials configured as per the [docs](https://docs.snowflake.com/en/user-guide/snowsql-config). You can then run the following command to setup the data:
```sh
./setup_snowflake.sh
```
This will create 1 database per database in the repo as before, using `public` as the default schema.

Note that the same sql files work for both the postgres and snowflake databases, so you can use the same sql files to setup both databases.

#### BigQuery, MySQL, SQLite, SQL Server
To set up the data in these systems, you would need your credentials to be configured in `utils_dialects`. You can then run the following command to set up the databases:
```
python translate_ddl_dialect.py
```
This will create one new SQL file per database per dialect.
For SQLite, the `.db` files will be saved in the folder `sqlite_dbs`.
Note that BigQuery, MySQL and SQLite do not support schemas and hence the SQL files will be modified to skip schema creation.

### Python Library

This is the recommended way to access the schema from the json files in a python environment. To use the python library in your code, navigate to this repository and install it using pip:
Expand Down
2 changes: 1 addition & 1 deletion setup_snowflake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
# get arguments
# if there are no arguments, set them to a default list
if [ $# -eq 0 ]; then
set -- academic advising atis geography restaurants scholar yelp
set -- academic advising atis geography restaurants scholar yelp broker car_dealership derm_treatment ewallet
fi
echo "Databases to init: $@"

Expand Down

0 comments on commit 608e181

Please sign in to comment.