Skip to content

Commit

Permalink
Merge pull request #30 from AnswerDotAI/enum
Browse files Browse the repository at this point in the history
fixed mixed imports / code
  • Loading branch information
hamelsmu authored Oct 5, 2024
2 parents 737cf54 + a624e59 commit 04f8204
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 113 deletions.
6 changes: 3 additions & 3 deletions fastlite/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def create(
res.cls = cls
return res

# %% ../nbs/00_core.ipynb 67
# %% ../nbs/00_core.ipynb 66
@patch
def import_file(self:Database, table_name, file, format=None, pk=None, alter=False):
"Import path or handle `file` to new table `table_name`"
Expand All @@ -197,7 +197,7 @@ def import_file(self:Database, table_name, file, format=None, pk=None, alter=Fal
if pk: tbl.transform(pk=pk)
return tbl

# %% ../nbs/00_core.ipynb 73
# %% ../nbs/00_core.ipynb 72
def _edge(tbl):
return "\n".join(f"{fk.table}:{fk.column} -> {fk.other_table}:{fk.other_column};"
for fk in tbl.foreign_keys)
Expand All @@ -215,7 +215,7 @@ def _tnode(tbl):
</table>"""
return f"{tbl.name} [label=<{res}>];\n"

# %% ../nbs/00_core.ipynb 74
# %% ../nbs/00_core.ipynb 73
def diagram(tbls, ratio=0.7, size="10", neato=False, render=True):
layout = "\nlayout=neato;\noverlap=prism;\noverlap_scaling=0.5;""" if neato else ""
edges = "\n".join(map(_edge, tbls))
Expand Down
Loading

0 comments on commit 04f8204

Please sign in to comment.