This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Create MIDAS SQLAlchemy ORM models #7
Comments
I have tried to generate the models using I followed these steps:
$ docker exec -it midas bash
$ sqlplus # use metadata as username and password
$ SQL> @/scripts/2.sql
$ SQL> @/scripts/3.sql
$ SQL> @/scripts/4.sql The down loaded oracle instant client 19.13 and But it throws
Looks like sqlacodegen cannot handle Then I tried this as a test: from sqlalchemy.engine import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy import Column, Integer
db_engine = create_engine("oracle+cx_oracle://metadata:metadata@127.0.0.1:1521/?service_name=XE")
Session = sessionmaker(autocommit=False, autoflush=False, bind=db_engine)
Base = declarative_base()
class EqptCalibCoeff(Base):
__tablename__ = "EQPT_CALIB_COEFF"
CALIB_COEFF_MSRT_ID = Column(Integer, primary_key=True)
EQPT_TYPE_CALIB_COEFF_ID = Column(Integer)
EQPT_CALIB_ID = Column(Integer)
CALIB_COEFF_VAL = Column(Integer)
def test_should_successfully_query_eqpt_calib_coeff():
session = Session()
session.query(EqptCalibCoeff).all()
assert True It passed. Should I try writing SQLAlchemy models manually? |
@chinedu117 would you like to pick this up and see if you can create models for the Oracle version of the midas schema? The earliest issues in this repository, that are now closed, give details of the process, e.g. opencdms-dev/pyopencdms#9 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Create SQLAlchemy 2.0-style ORM models for: MIDAS - requires opencdms-test-data#2 (Oracle Express)
The text was updated successfully, but these errors were encountered: