Skip to content

garbados/orchestrate-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orchestrate-sql

Imports a SQL database into Orchestrate (or vice versa) either as a CLI or in other Python scripts.

When importing, orchestrate-sql maps SQL tables to Orchestrate collections, and rows to key-values. For example, a table named users will be copied to a collection by the same name; each row within will be converted to a JSON document and inserted into the collection under the same key as their primary key in the SQL database.

When exporting, the tool maps likewise but in the other direction: copying collection contents to rows within tables in the destination database.

Install

Just use pip:

pip install orchestrate-sql

Then, use the CLI to copy a SQL database into Orchestrate:

orchestrate-sql import --api-key ORCHESTRATE_APP_KEY --sql-uri sql://URI_FOR_YOUR_DATABASE

Or, import it into other Python scripts:

import orchestrate_sql

orchestrate_sql.import(ORCHESTRATE_APP_KEY, URI_FOR_YOUR_DATABASE)

Usage

CLI

Both commands use the same option flags:

  • --api-key, -a: the Orchestrate API key for whatever application you want to sync with.
  • --sql-uri, -s: the connection URI for the SQL database you want to sync with.

import

Import data from a SQL database into Orchestrate.

export

Export data from Orchestrate into a SQL database.

Library

Both methods take the same arguments:

def import (ORCHESTRATE_API_KEY, SQL_URI):
    ...

def export (ORCHESTRATE_API_KEY, SQL_URI):
    ...

import

Import data from a SQL database into Orchestrate.

export

Export data from Orchestrate into a SQL database.

Tests

git clone https://github.com/garbados/orchestrate-sql.git
cd orchestrate-sql
python setup.py test

License

Apache-2.0

About

Import SQL databases into Orchestrate, with Python!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages