(name, schema)
| 38 | |
| 39 | |
| 40 | def create_database(name, schema): |
| 41 | # create FeatureBase database |
| 42 | fb_query = featurebase_query( |
| 43 | { |
| 44 | "sql": f"CREATE TABLE {name} {schema};" |
| 45 | } |
| 46 | ) |
| 47 | |
| 48 | # check status |
| 49 | if fb_query.get('error'): |
| 50 | if "exists" in fb_query.get('error'): |
| 51 | print(f"FeatureBase database `{name}` already exists.") |
| 52 | else: |
| 53 | print(fb_query.get("explain")) |
| 54 | print("FeatureBase returned an error. Check your credentials or create statement!") |
| 55 | else: |
| 56 | print(f"Created `{name}` database on FeatureBase Cloud.") |
| 57 | |
| 58 | |
| 59 | def apply_schema(list_of_lists, schema): |
no test coverage detected