Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add wrapper method that checks if a target table already exists in db #1

Open
json2d opened this issue Oct 7, 2020 · 0 comments

Comments

@json2d
Copy link
Owner

json2d commented Oct 7, 2020

so basically we want the downstream boilerplate for this to be:

import schematable as st

schl = st.parse('schedule')
if schdl.exists():
  # do the thing

w/o schematable, w/ only sqlalchemy

for some context here is the downstream boilerplate w/o this library completely

hint: this is basically the implementation so you can just copy and paste this in there 😉

import sqlalchemy as sa

schdl_db_url = 'sqlite://'
schdl_table = 'schedule'
schdl_engine = sa.create_engine(schdl_db_url)
if schdl_engine.has_table(schdl_table):
  # do the thing

w/ schematable

more context on the downstream boilerplate w/ this library

import schematable as st

schl = st.parse('schedule')
if schdl.engine.has_table(schdl.table, schdl.schema):
  # do the thing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant