Skip to content

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

Open
@json2d

Description

@json2d

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions