-
Notifications
You must be signed in to change notification settings - Fork 32
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
How to run the FastAPIQuickCRUD is NOT Clear #29
Comments
umm, I think just follow the readme is ok. And the FastAPIQuickCRUD and fastapi-crud-project-generator are different project. |
For example in FastAPIQuickCRUD, you can install
Then try with going to localhost:8000/docs |
Hi Sir,
Thanks for the prompt response.
I have a legacy Postgresql Table which has a few million records in it.
I want to autogenerate models with your project FastAPIQuickCRUD
will this project help,; if so kindly guide simple way
Thanks in advance
…On Mon, Nov 7, 2022 at 5:31 PM Luis ***@***.***> wrote:
For example in FastAPIQuickCRUD, you can run it directly by following code
(use in-memory db) and after pip install fastapi-quickcrud
`
import uvicorn
from fastapi import FastAPI
from sqlalchemy import Column, Integer,
String, Table, ForeignKey, orm
from fastapi_quickcrud import crud_router_builder
Base = orm.declarative_base()
class User(Base):
*tablename* = 'test_users'
id = Column(Integer, primary_key=True, autoincrement=True, unique=True)
name = Column(String, nullable=False)
email = Column(String, nullable=False)
friend = Table(
'test_friend', Base.metadata,
Column('id', ForeignKey('test_users.id', ondelete='CASCADE',
onupdate='CASCADE'), nullable=False),
Column('friend_name', String, nullable=False)
)
crud_route_1 = crud_router_builder(db_model=User,
prefix="/user",
tags=["User"],
async_mode=True
)
crud_route_2 = crud_router_builder(db_model=friend,
prefix="/friend",
tags=["friend"],
async_mode=True
)
app = FastAPI()
app.include_router(crud_route_1)
app.include_router(crud_route_2)
uvicorn.run(app, host="0.0.0.0", port=8000, debug=False)`
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU7SANH6SMZVV7X6AKLWHDVQXANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I see, seem u can run the above example normally, so u are trying to connect to your PostgreSQL DB
for the above example table creation sql statement is following
|
This project can only provide u some CRUD API with some basic query (try the first example to connect to in-memory in this issue) On the other head, if you want to add your own business logic into the api, I would like to suggest u try my another open source project, project generator with this example to connect your Postgresql DB. |
Dear Sir,
Thanks for the reply .
I created models using sqlagen
# coding: utf-8
from sqlalchemy import Column, DateTime, Index, Integer, Numeric, String,
Table, UniqueConstraint, text
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class TESTTABLE(Base):
__tablename__ = 'Testtable'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
....
...
I created these models in db.py file
And then copied your refrence code changed the sqlalchemy to
postgressql suitable and ran python main.py
but getting following error
server:/tmp/fastapi-crud-project-generator$ python main.py
Traceback (most recent call last):
File "main.py", line 3, in <module>
from fastapi_quickcrud import CrudMethods as CrudRouter
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/__init__.py",
line 1, in <module>
from .misc.utils import sqlalchemy_to_pydantic
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/misc/utils.py",
line 14, in <module>
from .crud_model import RequestResponseModel, CRUDModel
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/misc/crud_model.py",
line 13, in <module>
class RequestResponseModel(BaseModel):
File "pydantic/main.py", line 198, in pydantic.main.ModelMetaclass.__new__
File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 436, in
pydantic.fields.ModelField.__init__
File "pydantic/fields.py", line 557, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 831, in
pydantic.fields.ModelField.populate_validators
File "pydantic/validators.py", line 765, in find_validators
RuntimeError: no validator found for <class
'pydantic.main.ModelMetaclass'>, see `arbitrary_types_allowed` in Config
Could you kindly guide What else changes i have to make . THIS IS REALLY
VERY EXCITING PROJECT IF it works for me.
Thanking you
srikanth
…On Mon, Nov 7, 2022 at 8:01 PM Luis ***@***.***> wrote:
on the other head, if you want to add some business logic into the api, I
would like to suggest u try my another open source project, project
generator <https://github.com/LuisLuii/fastapi-crud-project-generator>
with this example
<https://github.com/LuisLuii/fastapi-crud-project-generator/blob/main/tutorial/generate_project_with_postgres_db_uuid_pk.py>
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU42MYZIMOVTO7J6T5TWHEHCLANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Seems your table has included a field that type did not have type validator. Could u share the Sqlalchemy schema for double check on my side? |
DearSir
engine = create_async_engine('postgresql+asyncpg://
***@***.***:5432/iibtestdb', future=True, echo=True,
pool_use_lifo=True, pool_pre_ping=True,
pool_recycle=7200)
…On Thu, Nov 17, 2022 at 4:17 PM Luis ***@***.***> wrote:
Dear Sir,
Thanks for the reply .
I created models using sqlagen
coding: utf-8
from sqlalchemy import Column, DateTime, Index, Integer, Numeric, String,
Table, UniqueConstraint, text
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class TESTTABLE(Base):
*tablename* = 'Testtable'
*table_args* = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('"HLT_CLAIM_2020_2021_GOVTs_id_seq"'::regclass)"))
....
...
I created these models in db.py file
And then copied your refrence code changed the sqlalchemy to
postgressql suitable and ran python main.py
but getting following error
server:/tmp/fastapi-crud-project-generator$ python main.py
Traceback (most recent call last):
File "main.py", line 3, in
from fastapi_quickcrud import CrudMethods as CrudRouter
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/*init*.py",
line 1, in
from .misc.utils import sqlalchemy_to_pydantic
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/misc/utils.py",
line 14, in
from .crud_model import RequestResponseModel, CRUDModel
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/misc/crud_model.py",
line 13, in
class RequestResponseModel(BaseModel):
File "pydantic/main.py", line 198, in pydantic.main.ModelMetaclass.*new*
File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 436, in
pydantic.fields.ModelField.*init*
File "pydantic/fields.py", line 557, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 831, in
pydantic.fields.ModelField.populate_validators
File "pydantic/validators.py", line 765, in find_validators
RuntimeError: no validator found for <class
'pydantic.main.ModelMetaclass'>, see arbitrary_types_allowed in Config
Could you kindly guide What else changes i have to make . THIS IS REALLY
VERY EXCITING PROJECT IF it works for me.
Thanking you
srikanth
On Mon, Nov 7, 2022 at 8:01 PM Luis *@*.***> wrote:
on the other head, if you want to add some business logic into the api, I
would like to suggest u try my another open source project, project
generator https://github.com/LuisLuii/fastapi-crud-project-generator
with this example
https://github.com/LuisLuii/fastapi-crud-project-generator/blob/main/tutorial/generate_project_with_postgres_db_uuid_pk.py
—
Reply to this email directly, view it on GitHub
#29 (comment)
<#29 (comment)>
,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEGAGU42MYZIMOVTO7J6T5TWHEHCLANCNFSM6AAAAAARZC3RSE
.
You are receiving this because you authored the thread.Message ID:
*@*.***>
Seems your table has included a field that type did not have type
validator. Could u share the Sqlalchemy schema for double on my side?
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU76OXYIYY5O74BIXKTWIYEM5ANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
sorry, I mean full code of this thing
|
Dear Sir,
Please keep in confidential with you only KINDLY
using sqlautogen redirected to db.py
# coding: utf-8
from sqlalchemy import Column, DateTime, Index, Integer, Numeric, String,
Table, UniqueConstraint, text
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class HLTCLAIM20202021GOVT(Base):
__tablename__ = 'HLT_CLAIM_2020_2021_GOVTs'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
TXT_TPA_CODE = Column(String(10))
TXT_INSURER_CODE = Column(String(10))
TXT_POLICY_NUMBER = Column(String(128))
TXT_MEMBER_REFERENCE_KEY = Column(String(128))
EMPLOYEE_ID = Column(String(128))
DATE_OF_BIRTH = Column(DateTime(True))
NUM_AGE_OF_INSURED = Column(Integer)
DATE_POLICY_START = Column(DateTime(True))
DATE_POLICY_END = Column(DateTime(True))
TXT_PRODUCT_TYPE = Column(String(128))
TXT_TYPE_OF_POLICY = Column(String(128))
BOO_FLOATER_APPLICABLE = Column(String(5))
TXT_GENDER = Column(String(10))
NUM_SUM_INSURED = Column(Numeric(30, 2))
TXT_CLAIM_NUMBER = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_I = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_I = Column(String(1000))
TXT_NAME_OF_THE_HOSPITAL = Column(String(8000))
TXT_REGISTRATION_NUMBER_OF_HOSPITAL = Column(String(128))
TXT_PAN_OF_HOSPITAL = Column(String(128))
TXT_PIN_CODE_OF_HOSPITAL = Column(String(20))
DATE_OF_ADMISSION = Column(DateTime(True))
DATE_OF_DISCHARGE = Column(DateTime(True))
NUM_TOTAL_AMOUNT_CLAIMED = Column(Numeric(30, 2))
NUM_ROOM_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_NURSING_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_SURGERY_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_CONSULTATION_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_DIAGONOSTIC_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_MEDICINE_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_MISCELLANEOUS_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_PRE_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
NUM_POST_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
NUM_PROFESSIONAL_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_OT_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_SURGICAL_IMPLANT_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_TOTAL_CLAIM_PAID = Column(Numeric(30, 2))
NUM_INDEMNITY_PAID = Column(Numeric(30, 2))
NUM_HOSPITAL_DAILY_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_CRITICAL_ILLNESS_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_SURGICAL_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_CONVALESCENCE_BENEFIT_PAID = Column(Numeric(30, 2))
TXT_REASON_FOR_REJECTION_OF_CLAIM = Column(String(128))
TXT_CLAIM_REMARKS = Column(String(8000))
TXT_DIAGNOSIS_CODE_LEVEL_II = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_III = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_II = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_III = Column(String(128))
TXT_MEDICAL_HISTORY_LEVEL_I = Column(String(1000))
TXT_HOSPITAL_CODE = Column(String(128))
TXT_PROCEDURE_DESCRIPTION_LEVEL_I = Column(String(8000))
TXT_PROCEDURE_DESCRIPTION_LEVEL_II = Column(String(1000))
TXT_PROCEDURE_DESCRIPTION_LEVEL_III = Column(String(1000))
TXT_MEDICAL_HISTORY_LEVEL_II = Column(String(1000))
TXT_MEDICAL_HISTORY_LEVEL_III = Column(String(8000))
TXT_REASON_FOR_REDUCTION_OF_CLAIM = Column(String(1000))
TXT_TYPE_OF_CLAIM_PAYMENT = Column(String(128))
TXT_SYSTEM_OF_MEDICINE_USED = Column(String(128))
BOO_HOSPITAL_IS_NETWORK_PROVIDER = Column(String(5))
NUM_AMOUNT_OF_DEDUCTIBLE = Column(Numeric(30, 2))
NUM_PERCENTAGE_OF_COPAYMENT = Column(Numeric(20, 3))
NUM_AMOUNT_OF_COPAYMENT = Column(Numeric(30, 2))
DATE_OF_PAYMENT = Column(DateTime(True))
TXT_PAYMENT_REFERENCE_NUMBER = Column(String(128))
DATE_CLAIM_INTIMATION = Column(DateTime(True))
NUM_BONUS_SUM_INSURED = Column(Numeric(30, 2))
BOO_CLAIM_REOPENED_OR_NOT = Column(String(5))
TXT_CLAIM_STATUS = Column(String(10))
BOO_SURGICAL_OR_NON_SURGICAL_TREATMENT = Column(String(5))
BOO_OUT_PATIENT_OR_IN_PATIENT_TREATMENT = Column(String(5))
TXT_IRDA_PRODUCT_ID = Column(String(128))
TXT_CRITICAL_ILLNESS_DISEASE_CODE = Column(String(128))
NUM_OPENING_CLAIM_PROVISION = Column(Numeric(30, 2))
NUM_CLOSING_CLAIM_PROVISION = Column(Numeric(30, 2))
TXT_TRANSACTION_ID = Column(String(128))
DATE_TRANSACTION_ID = Column(DateTime(True))
TXT_REASON_FOR_HOSPITALISATION = Column(String(128))
TXT_TREATING_DOCTOR_REGISTRATION_NUMBER = Column(String(128))
TXT_TYPE_OF_ADMISSION = Column(String(128))
TXT_ROOM_CATEGORY_OCCUPIED = Column(String(128))
DATE_OF_RECEIPT_OF_COMPLETE_CLAIM_DOCUMENT = Column(DateTime(True))
TXT_PATIENT_ID = Column(String(128))
DATE_OF_COMMENCEMENT_OF_FIRST_INSURANCE_WITHOUT_BREAK =
Column(DateTime(True))
LOAD_MONTH = Column(String(15))
FILE_NAME = Column(String(1000))
FINANCIAL_YEAR = Column(String(10))
RECONCILE_FLAG = Column(String(5), server_default=text("'0'::character
varying"))
createdBy = Column(String(128))
updatedBy = Column(String(128))
createdAt = Column(DateTime(True))
updatedAt = Column(DateTime(True))
dataCategory = Column(String(128),
server_default=text("'govt'::character varying"))
SIMILARLY OTHER class tables created sample below
class HLTCLAIM20202021(Base):
__tablename__ = 'HLT_CLAIM_2020_2021s'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021s_id_seq\"'::regclass)"))
TXT_TPA_CODE = Column(String(10))
TXT_INSURER_CODE = Column(String(10))
TXT_POLICY_NUMBER = Column(String(128))
TXT_MEMBER_REFERENCE_KEY = Column(String(128))
EMPLOYEE_ID = Column(String(128))
DATE_OF_BIRTH = Column(DateTime(True))
NUM_AGE_OF_INSURED = Column(Integer)
DATE_POLICY_START = Column(DateTime(True))
DATE_POLICY_END = Column(DateTime(True))
All i need is one table How to make it run as API with your excellent
project ( READ/ WRITE /SINGLE/MULIPLTE/ SYNC / ASYNC ) One example if it
works I WILL BE GREATEFUL to your help
Thanking you
…On Thu, Nov 17, 2022 at 4:58 PM Luis ***@***.***> wrote:
sorry, I mean this thing of full code
class TESTTABLE(Base):
__tablename__ = 'Testtable'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU7MGR3OX6NJSNORHBLWIYJEVANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Dear Sir,
Please keep code confidential KINDLY
using sqlautogen redirected to db.py
# coding: utf-8
from sqlalchemy import Column, DateTime, Index, Integer, Numeric, String,
Table, UniqueConstraint, text
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class HLTCLAIM20202021GOVT(Base):
__tablename__ = 'HLT_CLAIM_2020_2021_GOVTs'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
TXT_TPA_CODE = Column(String(10))
TXT_INSURER_CODE = Column(String(10))
TXT_POLICY_NUMBER = Column(String(128))
TXT_MEMBER_REFERENCE_KEY = Column(String(128))
EMPLOYEE_ID = Column(String(128))
DATE_OF_BIRTH = Column(DateTime(True))
NUM_AGE_OF_INSURED = Column(Integer)
DATE_POLICY_START = Column(DateTime(True))
DATE_POLICY_END = Column(DateTime(True))
TXT_PRODUCT_TYPE = Column(String(128))
TXT_TYPE_OF_POLICY = Column(String(128))
BOO_FLOATER_APPLICABLE = Column(String(5))
TXT_GENDER = Column(String(10))
NUM_SUM_INSURED = Column(Numeric(30, 2))
TXT_CLAIM_NUMBER = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_I = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_I = Column(String(1000))
TXT_NAME_OF_THE_HOSPITAL = Column(String(8000))
TXT_REGISTRATION_NUMBER_OF_HOSPITAL = Column(String(128))
TXT_PAN_OF_HOSPITAL = Column(String(128))
TXT_PIN_CODE_OF_HOSPITAL = Column(String(20))
DATE_OF_ADMISSION = Column(DateTime(True))
DATE_OF_DISCHARGE = Column(DateTime(True))
NUM_TOTAL_AMOUNT_CLAIMED = Column(Numeric(30, 2))
NUM_ROOM_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_NURSING_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_SURGERY_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_CONSULTATION_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_DIAGONOSTIC_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_MEDICINE_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_MISCELLANEOUS_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_PRE_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
NUM_POST_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
NUM_PROFESSIONAL_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_OT_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_SURGICAL_IMPLANT_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_TOTAL_CLAIM_PAID = Column(Numeric(30, 2))
NUM_INDEMNITY_PAID = Column(Numeric(30, 2))
NUM_HOSPITAL_DAILY_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_CRITICAL_ILLNESS_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_SURGICAL_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_CONVALESCENCE_BENEFIT_PAID = Column(Numeric(30, 2))
TXT_REASON_FOR_REJECTION_OF_CLAIM = Column(String(128))
TXT_CLAIM_REMARKS = Column(String(8000))
TXT_DIAGNOSIS_CODE_LEVEL_II = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_III = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_II = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_III = Column(String(128))
TXT_MEDICAL_HISTORY_LEVEL_I = Column(String(1000))
TXT_HOSPITAL_CODE = Column(String(128))
TXT_PROCEDURE_DESCRIPTION_LEVEL_I = Column(String(8000))
TXT_PROCEDURE_DESCRIPTION_LEVEL_II = Column(String(1000))
TXT_PROCEDURE_DESCRIPTION_LEVEL_III = Column(String(1000))
TXT_MEDICAL_HISTORY_LEVEL_II = Column(String(1000))
TXT_MEDICAL_HISTORY_LEVEL_III = Column(String(8000))
TXT_REASON_FOR_REDUCTION_OF_CLAIM = Column(String(1000))
TXT_TYPE_OF_CLAIM_PAYMENT = Column(String(128))
TXT_SYSTEM_OF_MEDICINE_USED = Column(String(128))
BOO_HOSPITAL_IS_NETWORK_PROVIDER = Column(String(5))
NUM_AMOUNT_OF_DEDUCTIBLE = Column(Numeric(30, 2))
NUM_PERCENTAGE_OF_COPAYMENT = Column(Numeric(20, 3))
NUM_AMOUNT_OF_COPAYMENT = Column(Numeric(30, 2))
DATE_OF_PAYMENT = Column(DateTime(True))
TXT_PAYMENT_REFERENCE_NUMBER = Column(String(128))
DATE_CLAIM_INTIMATION = Column(DateTime(True))
NUM_BONUS_SUM_INSURED = Column(Numeric(30, 2))
BOO_CLAIM_REOPENED_OR_NOT = Column(String(5))
TXT_CLAIM_STATUS = Column(String(10))
BOO_SURGICAL_OR_NON_SURGICAL_TREATMENT = Column(String(5))
BOO_OUT_PATIENT_OR_IN_PATIENT_TREATMENT = Column(String(5))
TXT_IRDA_PRODUCT_ID = Column(String(128))
TXT_CRITICAL_ILLNESS_DISEASE_CODE = Column(String(128))
NUM_OPENING_CLAIM_PROVISION = Column(Numeric(30, 2))
NUM_CLOSING_CLAIM_PROVISION = Column(Numeric(30, 2))
TXT_TRANSACTION_ID = Column(String(128))
DATE_TRANSACTION_ID = Column(DateTime(True))
TXT_REASON_FOR_HOSPITALISATION = Column(String(128))
TXT_TREATING_DOCTOR_REGISTRATION_NUMBER = Column(String(128))
TXT_TYPE_OF_ADMISSION = Column(String(128))
TXT_ROOM_CATEGORY_OCCUPIED = Column(String(128))
DATE_OF_RECEIPT_OF_COMPLETE_CLAIM_DOCUMENT = Column(DateTime(True))
TXT_PATIENT_ID = Column(String(128))
DATE_OF_COMMENCEMENT_OF_FIRST_INSURANCE_WITHOUT_BREAK =
Column(DateTime(True))
LOAD_MONTH = Column(String(15))
FILE_NAME = Column(String(1000))
FINANCIAL_YEAR = Column(String(10))
RECONCILE_FLAG = Column(String(5), server_default=text("'0'::character
varying"))
createdBy = Column(String(128))
updatedBy = Column(String(128))
createdAt = Column(DateTime(True))
updatedAt = Column(DateTime(True))
dataCategory = Column(String(128),
server_default=text("'govt'::character varying"))
SIMILARLY OTHER class tables created sample below
class HLTCLAIM20202021(Base):
__tablename__ = 'HLT_CLAIM_2020_2021s'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021s_id_seq\"'::regclass)"))
TXT_TPA_CODE = Column(String(10))
TXT_INSURER_CODE = Column(String(10))
TXT_POLICY_NUMBER = Column(String(128))
TXT_MEMBER_REFERENCE_KEY = Column(String(128))
EMPLOYEE_ID = Column(String(128))
DATE_OF_BIRTH = Column(DateTime(True))
NUM_AGE_OF_INSURED = Column(Integer)
DATE_POLICY_START = Column(DateTime(True))
DATE_POLICY_END = Column(DateTime(True))
All i need is one table How to make it run as API with your excellent
project ( READ/ WRITE /SINGLE/MULIPLTE/ SYNC / ASYNC ) One example if it
works I WILL BE GREATEFUL to your help
Thanking you
…On Thu, Nov 17, 2022 at 4:58 PM Luis ***@***.***> wrote:
sorry, I mean this thing of full code
class TESTTABLE(Base):
__tablename__ = 'Testtable'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU7MGR3OX6NJSNORHBLWIYJEVANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello, I have tested the following code by your Sqlalchemy schema and it works fine
|
but I cannot make a api test since I don't have data of the table, I think It should works |
O.k Sir,
I will try this new code
Thanks for your kind support to me.
Regards,
…On Thu, Nov 17, 2022 at 5:34 PM Luis ***@***.***> wrote:
but I cannot make a api test since I have not data of the table, but I
think It should works
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGUZHJLJ3YZREKY34DPLWIYNMPANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
welcome to let me know if it's works, and if you have any confidential policy I can hide the Sqlalchemy schema code for the above comment |
Dear Sir,
I again created sqlautoten db.py
and copied your code as test.py
and ran python test.py CHANGING THE SQLALCHEMY URL
it-server:/tmp/fastapi-crud-template-generator-main$ python test.py
Traceback (most recent call last):
File "test.py", line 6, in <module>
from fastapi_quickcrud.crud_router import crud_router_builder
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/__init__.py",
line 1, in <module>
from .misc.utils import sqlalchemy_to_pydantic
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/misc/utils.py",
line 14, in <module>
from .crud_model import RequestResponseModel, CRUDModel
File
"/tmp/testenv/lib/python3.8/site-packages/fastapi_quickcrud/misc/crud_model.py",
line 13, in <module>
class RequestResponseModel(BaseModel):
* File "pydantic/main.py", line 198, in
pydantic.main.ModelMetaclass.__new__ File "pydantic/fields.py", line 506,
in pydantic.fields.ModelField.infer File "pydantic/fields.py", line 436,
in pydantic.fields.ModelField.__init__ File "pydantic/fields.py", line
557, in pydantic.fields.ModelField.prepare File "pydantic/fields.py", line
831, in pydantic.fields.ModelField.populate_validators File
"pydantic/validators.py", line 765, in find_validatorsRuntimeError: no
validator found for <class 'pydantic.main.ModelMetaclass'>, see
`arbitrary_types_allowed` in Config*
I think i am making some mistake
Could be in sqlalchemy string
engine = create_async_engine('postgresql+asyncpg://<user>:<password>@
10.0.2.35/postgres', future=True, echo=True,
pool_use_lifo=True, pool_pre_ping=True,
pool_recycle=7200)
user and password are correct only
Can you take remote access and guide me on this please IF O.K
Thanking you
srik
…On Thu, Nov 17, 2022 at 5:43 PM Luis ***@***.***> wrote:
welcome to let me know if it's works, and if you have any confidential
policy I can hide the Sqlalchemy schema code for the above comment
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGUZMUBZFQM6ONMFAKNLWIYOOVANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
could you try to create a new virtual env, and install the package |
Dear Sir,
I again created new env it worked *AMAZING *
[image: image.png]
This is one of the inspiration project for me and many people.
We will be able to create using sqlacodegen LEGACY Database models
and run your excellent program.
Now please guide , if i can use this API to use the Endpoint and it does
CRUD into the Actual Postgresql Database
Thanks for your excellent support sir.
HANDs up to your great knowledge and support
PLEASE DELETE MY CONFIDENTIAL SQLACLHEMY STRINGS AND MODELS
Thanking you again
…On Thu, Nov 17, 2022 at 5:54 PM Luis ***@***.***> wrote:
could you try to create a new virtual env, and instal the package pip
install fastapi_quickcrud and run your code. if still not works, welcome
to chat with me on telegram @llui1123
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU5UH75IONBT5P3RGK3WIYPWXANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Happy to know that this project can help you well. Btw, welcome to use another project of mine if you need to customize the api router
|
What is this project purpose sir
Please explain in brief
My requirement is I have legacy database in postgresql and MSSQL
These database tables should be EXPOSED with High performance API ( CRUD )
The stakeholders will push multiple records in POST and we should be able
to validate using pydantic , throw success records inserted in DB and
failed recorrds
similarly search.
If any of your project meets this requirement WHICH i can extend.
I will be very grateful to you.
Thanking you in advance.
Please also remove some confidential code fragments of my table name etc.
…On Thu, Nov 17, 2022 at 6:26 PM Luis ***@***.***> wrote:
Happy to know that this project can help you well. Btw, welcome to use
another project of mine if you need to customize the api router
crud code gen
<https://github.com/LuisLuii/fastapi-crud-template-generator>
from sqlalchemy import *
from sqlalchemy.orm import declarative_base
from fastapi_quickcrud_codegen.db_model import DbModel
Base = declarative_base()
metadata = Base.metadata
class HLTCLAIM20202021GOVT(Base):
__tablename__ = 'HLT_CLAIM_2020_2021_GOVTs'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
TXT_TPA_CODE = Column(String(10))
TXT_INSURER_CODE = Column(String(10))
TXT_POLICY_NUMBER = Column(String(128))
TXT_MEMBER_REFERENCE_KEY = Column(String(128))
EMPLOYEE_ID = Column(String(128))
DATE_OF_BIRTH = Column(DateTime(True))
NUM_AGE_OF_INSURED = Column(Integer)
DATE_POLICY_START = Column(DateTime(True))
DATE_POLICY_END = Column(DateTime(True))
TXT_PRODUCT_TYPE = Column(String(128))
TXT_TYPE_OF_POLICY = Column(String(128))
BOO_FLOATER_APPLICABLE = Column(String(5))
TXT_GENDER = Column(String(10))
NUM_SUM_INSURED = Column(Numeric(30, 2))
TXT_CLAIM_NUMBER = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_I = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_I = Column(String(1000))
TXT_NAME_OF_THE_HOSPITAL = Column(String(8000))
TXT_REGISTRATION_NUMBER_OF_HOSPITAL = Column(String(128))
TXT_PAN_OF_HOSPITAL = Column(String(128))
TXT_PIN_CODE_OF_HOSPITAL = Column(String(20))
DATE_OF_ADMISSION = Column(DateTime(True))
DATE_OF_DISCHARGE = Column(DateTime(True))
NUM_TOTAL_AMOUNT_CLAIMED = Column(Numeric(30, 2))
NUM_ROOM_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_NURSING_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_SURGERY_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_CONSULTATION_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_DIAGONOSTIC_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_MEDICINE_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_MISCELLANEOUS_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_PRE_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
NUM_POST_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
NUM_PROFESSIONAL_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_OT_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_SURGICAL_IMPLANT_CHARGES_CLAIMED = Column(Numeric(30, 2))
NUM_TOTAL_CLAIM_PAID = Column(Numeric(30, 2))
NUM_INDEMNITY_PAID = Column(Numeric(30, 2))
NUM_HOSPITAL_DAILY_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_CRITICAL_ILLNESS_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_SURGICAL_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
NUM_CONVALESCENCE_BENEFIT_PAID = Column(Numeric(30, 2))
TXT_REASON_FOR_REJECTION_OF_CLAIM = Column(String(128))
TXT_CLAIM_REMARKS = Column(String(8000))
TXT_DIAGNOSIS_CODE_LEVEL_II = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_III = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_II = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_III = Column(String(128))
TXT_MEDICAL_HISTORY_LEVEL_I = Column(String(1000))
TXT_HOSPITAL_CODE = Column(String(128))
TXT_PROCEDURE_DESCRIPTION_LEVEL_I = Column(String(8000))
TXT_PROCEDURE_DESCRIPTION_LEVEL_II = Column(String(1000))
TXT_PROCEDURE_DESCRIPTION_LEVEL_III = Column(String(1000))
TXT_MEDICAL_HISTORY_LEVEL_II = Column(String(1000))
TXT_MEDICAL_HISTORY_LEVEL_III = Column(String(8000))
TXT_REASON_FOR_REDUCTION_OF_CLAIM = Column(String(1000))
TXT_TYPE_OF_CLAIM_PAYMENT = Column(String(128))
TXT_SYSTEM_OF_MEDICINE_USED = Column(String(128))
BOO_HOSPITAL_IS_NETWORK_PROVIDER = Column(String(5))
NUM_AMOUNT_OF_DEDUCTIBLE = Column(Numeric(30, 2))
NUM_PERCENTAGE_OF_COPAYMENT = Column(Numeric(20, 3))
NUM_AMOUNT_OF_COPAYMENT = Column(Numeric(30, 2))
DATE_OF_PAYMENT = Column(DateTime(True))
TXT_PAYMENT_REFERENCE_NUMBER = Column(String(128))
DATE_CLAIM_INTIMATION = Column(DateTime(True))
NUM_BONUS_SUM_INSURED = Column(Numeric(30, 2))
BOO_CLAIM_REOPENED_OR_NOT = Column(String(5))
TXT_CLAIM_STATUS = Column(String(10))
BOO_SURGICAL_OR_NON_SURGICAL_TREATMENT = Column(String(5))
BOO_OUT_PATIENT_OR_IN_PATIENT_TREATMENT = Column(String(5))
TXT_IRDA_PRODUCT_ID = Column(String(128))
TXT_CRITICAL_ILLNESS_DISEASE_CODE = Column(String(128))
NUM_OPENING_CLAIM_PROVISION = Column(Numeric(30, 2))
NUM_CLOSING_CLAIM_PROVISION = Column(Numeric(30, 2))
TXT_TRANSACTION_ID = Column(String(128))
DATE_TRANSACTION_ID = Column(DateTime(True))
TXT_REASON_FOR_HOSPITALISATION = Column(String(128))
TXT_TREATING_DOCTOR_REGISTRATION_NUMBER = Column(String(128))
TXT_TYPE_OF_ADMISSION = Column(String(128))
TXT_ROOM_CATEGORY_OCCUPIED = Column(String(128))
DATE_OF_RECEIPT_OF_COMPLETE_CLAIM_DOCUMENT = Column(DateTime(True))
TXT_PATIENT_ID = Column(String(128))
DATE_OF_COMMENCEMENT_OF_FIRST_INSURANCE_WITHOUT_BREAK = Column(DateTime(True))
LOAD_MONTH = Column(String(15))
FILE_NAME = Column(String(1000))
FINANCIAL_YEAR = Column(String(10))
RECONCILE_FLAG = Column(String(5), server_default=text("'0'::charactervarying"))
createdBy = Column(String(128))
updatedBy = Column(String(128))
createdAt = Column(DateTime(True))
updatedAt = Column(DateTime(True))
dataCategory = Column(String(128), server_default=text("'govt'::character varying"))
from fastapi_quickcrud_codegen import crud_router_builder
model_list = [DbModel(db_model=HLTCLAIM20202021GOVT, prefix="/my_first_api", tags=["sample api"])]
crud_router_builder(
db_model_list=model_list,
is_async=True,
***@***.***:5432/postgres"
)
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU7PO6ZJNRO2BFFVQEDWIYTQDANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Dear Sir,
I tried this project
server:/tmp/fastapi-crud-template-generator-main$ python crud.py
Traceback (most recent call last):
File "crud.py", line 4, in <module>
from fastapi_quickcrud_codegen.db_model import DbModel
ModuleNotFoundError: No module named 'fastapi_quickcrud_codegen'
(myenv)git-server:/tmp/fastapi-crud-template-generator-main$ pip install
fastapi_quickcrud_codegen
ERROR: Could not find a version that satisfies the requirement
fastapi_quickcrud_codegen (from versions: none)
ERROR: No matching distribution found for fastapi_quickcrud_codegen
(myenv) ***@***.***:/tmp/fastapi-crud-template-generator-main$
How do i fix this problem?
Thanks
On Thu, Nov 17, 2022 at 6:34 PM Srikanth Pokkuluri ***@***.***>
wrote:
… What is this project purpose sir
Please explain in brief
My requirement is I have legacy database in postgresql and MSSQL
These database tables should be EXPOSED with High performance API ( CRUD )
The stakeholders will push multiple records in POST and we should be able
to validate using pydantic , throw success records inserted in DB and
failed recorrds
similarly search.
If any of your project meets this requirement WHICH i can extend.
I will be very grateful to you.
Thanking you in advance.
Please also remove some confidential code fragments of my table name etc.
On Thu, Nov 17, 2022 at 6:26 PM Luis ***@***.***> wrote:
> Happy to know that this project can help you well. Btw, welcome to use
> another project of mine if you need to customize the api router
> crud code gen
> <https://github.com/LuisLuii/fastapi-crud-template-generator>
>
> from sqlalchemy import *
> from sqlalchemy.orm import declarative_base
>
> from fastapi_quickcrud_codegen.db_model import DbModel
>
> Base = declarative_base()
> metadata = Base.metadata
>
>
> class HLTCLAIM20202021GOVT(Base):
> __tablename__ = 'HLT_CLAIM_2020_2021_GOVTs'
> __table_args__ = (
> UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
> 'LOAD_MONTH', 'RECONCILE_FLAG'),
> )
>
> id = Column(Integer, primary_key=True,
> server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
> TXT_TPA_CODE = Column(String(10))
> TXT_INSURER_CODE = Column(String(10))
> TXT_POLICY_NUMBER = Column(String(128))
> TXT_MEMBER_REFERENCE_KEY = Column(String(128))
> EMPLOYEE_ID = Column(String(128))
> DATE_OF_BIRTH = Column(DateTime(True))
> NUM_AGE_OF_INSURED = Column(Integer)
> DATE_POLICY_START = Column(DateTime(True))
> DATE_POLICY_END = Column(DateTime(True))
> TXT_PRODUCT_TYPE = Column(String(128))
> TXT_TYPE_OF_POLICY = Column(String(128))
> BOO_FLOATER_APPLICABLE = Column(String(5))
> TXT_GENDER = Column(String(10))
> NUM_SUM_INSURED = Column(Numeric(30, 2))
> TXT_CLAIM_NUMBER = Column(String(128))
> TXT_DIAGNOSIS_CODE_LEVEL_I = Column(String(128))
> TXT_PROCEDURE_CODE_LEVEL_I = Column(String(1000))
> TXT_NAME_OF_THE_HOSPITAL = Column(String(8000))
> TXT_REGISTRATION_NUMBER_OF_HOSPITAL = Column(String(128))
> TXT_PAN_OF_HOSPITAL = Column(String(128))
> TXT_PIN_CODE_OF_HOSPITAL = Column(String(20))
> DATE_OF_ADMISSION = Column(DateTime(True))
> DATE_OF_DISCHARGE = Column(DateTime(True))
> NUM_TOTAL_AMOUNT_CLAIMED = Column(Numeric(30, 2))
> NUM_ROOM_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_NURSING_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_SURGERY_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_CONSULTATION_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_DIAGONOSTIC_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_MEDICINE_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_MISCELLANEOUS_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_PRE_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
> NUM_POST_HOSPITALISATION_EXPENSES_CLAIMED = Column(Numeric(30, 2))
> NUM_PROFESSIONAL_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_OT_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_SURGICAL_IMPLANT_CHARGES_CLAIMED = Column(Numeric(30, 2))
> NUM_TOTAL_CLAIM_PAID = Column(Numeric(30, 2))
> NUM_INDEMNITY_PAID = Column(Numeric(30, 2))
> NUM_HOSPITAL_DAILY_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
> NUM_CRITICAL_ILLNESS_BENEFIT_PAID = Column(Numeric(30, 2))
> NUM_SURGICAL_CASH_BENEFIT_PAID = Column(Numeric(30, 2))
> NUM_CONVALESCENCE_BENEFIT_PAID = Column(Numeric(30, 2))
> TXT_REASON_FOR_REJECTION_OF_CLAIM = Column(String(128))
> TXT_CLAIM_REMARKS = Column(String(8000))
> TXT_DIAGNOSIS_CODE_LEVEL_II = Column(String(128))
> TXT_DIAGNOSIS_CODE_LEVEL_III = Column(String(128))
> TXT_PROCEDURE_CODE_LEVEL_II = Column(String(128))
> TXT_PROCEDURE_CODE_LEVEL_III = Column(String(128))
> TXT_MEDICAL_HISTORY_LEVEL_I = Column(String(1000))
> TXT_HOSPITAL_CODE = Column(String(128))
> TXT_PROCEDURE_DESCRIPTION_LEVEL_I = Column(String(8000))
> TXT_PROCEDURE_DESCRIPTION_LEVEL_II = Column(String(1000))
> TXT_PROCEDURE_DESCRIPTION_LEVEL_III = Column(String(1000))
> TXT_MEDICAL_HISTORY_LEVEL_II = Column(String(1000))
> TXT_MEDICAL_HISTORY_LEVEL_III = Column(String(8000))
> TXT_REASON_FOR_REDUCTION_OF_CLAIM = Column(String(1000))
> TXT_TYPE_OF_CLAIM_PAYMENT = Column(String(128))
> TXT_SYSTEM_OF_MEDICINE_USED = Column(String(128))
> BOO_HOSPITAL_IS_NETWORK_PROVIDER = Column(String(5))
> NUM_AMOUNT_OF_DEDUCTIBLE = Column(Numeric(30, 2))
> NUM_PERCENTAGE_OF_COPAYMENT = Column(Numeric(20, 3))
> NUM_AMOUNT_OF_COPAYMENT = Column(Numeric(30, 2))
> DATE_OF_PAYMENT = Column(DateTime(True))
> TXT_PAYMENT_REFERENCE_NUMBER = Column(String(128))
> DATE_CLAIM_INTIMATION = Column(DateTime(True))
> NUM_BONUS_SUM_INSURED = Column(Numeric(30, 2))
> BOO_CLAIM_REOPENED_OR_NOT = Column(String(5))
> TXT_CLAIM_STATUS = Column(String(10))
> BOO_SURGICAL_OR_NON_SURGICAL_TREATMENT = Column(String(5))
> BOO_OUT_PATIENT_OR_IN_PATIENT_TREATMENT = Column(String(5))
> TXT_IRDA_PRODUCT_ID = Column(String(128))
> TXT_CRITICAL_ILLNESS_DISEASE_CODE = Column(String(128))
> NUM_OPENING_CLAIM_PROVISION = Column(Numeric(30, 2))
> NUM_CLOSING_CLAIM_PROVISION = Column(Numeric(30, 2))
> TXT_TRANSACTION_ID = Column(String(128))
> DATE_TRANSACTION_ID = Column(DateTime(True))
> TXT_REASON_FOR_HOSPITALISATION = Column(String(128))
> TXT_TREATING_DOCTOR_REGISTRATION_NUMBER = Column(String(128))
> TXT_TYPE_OF_ADMISSION = Column(String(128))
> TXT_ROOM_CATEGORY_OCCUPIED = Column(String(128))
> DATE_OF_RECEIPT_OF_COMPLETE_CLAIM_DOCUMENT = Column(DateTime(True))
> TXT_PATIENT_ID = Column(String(128))
> DATE_OF_COMMENCEMENT_OF_FIRST_INSURANCE_WITHOUT_BREAK = Column(DateTime(True))
> LOAD_MONTH = Column(String(15))
> FILE_NAME = Column(String(1000))
> FINANCIAL_YEAR = Column(String(10))
> RECONCILE_FLAG = Column(String(5), server_default=text("'0'::charactervarying"))
> createdBy = Column(String(128))
> updatedBy = Column(String(128))
> createdAt = Column(DateTime(True))
> updatedAt = Column(DateTime(True))
> dataCategory = Column(String(128), server_default=text("'govt'::character varying"))
>
>
> from fastapi_quickcrud_codegen import crud_router_builder
>
> model_list = [DbModel(db_model=HLTCLAIM20202021GOVT, prefix="/my_first_api", tags=["sample api"])]
> crud_router_builder(
> db_model_list=model_list,
> is_async=True,
> ***@***.***:5432/postgres"
> )
>
> —
> Reply to this email directly, view it on GitHub
> <#29 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEGAGU7PO6ZJNRO2BFFVQEDWIYTQDANCNFSM6AAAAAARZC3RSE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
It has the same purpose with this project, but it supports code generation so that you can extend the code easily, such as add some business logic in the api router or modify the Pedantic/Dataclass model, api end point etc... |
it should be |
Thanks Sir
I will use this
…On Thursday, November 17, 2022, Luis ***@***.***> wrote:
Dear Sir, I tried this project server:/tmp/fastapi-crud-template-generator-main$
python crud.py Traceback (most recent call last): File "crud.py", line 4,
in from fastapi_quickcrud_codegen.db_model import DbModel
ModuleNotFoundError: No module named 'fastapi_quickcrud_codegen'
(myenv)git-server:/tmp/fastapi-crud-template-generator-main$ pip install
fastapi_quickcrud_codegen ERROR: Could not find a version that satisfies
the requirement fastapi_quickcrud_codegen (from versions: none) ERROR: No
matching distribution found for fastapi_quickcrud_codegen (myenv) *@*.*:/tmp/fastapi-crud-template-generator-main$
How do i fix this problem? Thanks On Thu, Nov 17, 2022 at 6:34 PM Srikanth
Pokkuluri @.*> wrote:
… <#m_-2484583352249983500_>
it should be pip install fastapi-crud-code-generator
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU5SKEQDPFIIQBP6IDLWIYWBPANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Dear Sir,
I am trying to autogen from MS SQL Server But failing to create classes
with some security error I tried all combinations
sqlalchemy.exc.OperationalError: (pyodbc.OperationalError) ('08001',
'[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider:
[error:1416F086:SSL routines:tls_process_server_certificate:certificate
verify failed:self signed certificate] (-1) (SQLDriverConnect)')
Any hint what i should do?
And when i ran crud.py application GetMany
Its failing 022-11-18 11:13:16,771 INFO sqlalchemy.engine.Engine [generated
in 0.00078s] (Decimal('50000'), Decimal('100000'))
*2022-11-18 11:27:31,155 INFO sqlalchemy.engine.Engine COMMITKilled*
(crudenv) server:/tmp/fastapi-crud-template-generator-main$
Any suggestions.
Because the table size is very huge in crore records SO IS It failing
becuase of table size ?
Please suggest and advice
Thanks
On Thu, Nov 17, 2022 at 7:39 PM Srikanth Pokkuluri ***@***.***>
wrote:
… Thanks Sir
I will use this
On Thursday, November 17, 2022, Luis ***@***.***> wrote:
> Dear Sir, I tried this project
> server:/tmp/fastapi-crud-template-generator-main$ python crud.py Traceback
> (most recent call last): File "crud.py", line 4, in from
> fastapi_quickcrud_codegen.db_model import DbModel ModuleNotFoundError: No
> module named 'fastapi_quickcrud_codegen'
> (myenv)git-server:/tmp/fastapi-crud-template-generator-main$ pip install
> fastapi_quickcrud_codegen ERROR: Could not find a version that satisfies
> the requirement fastapi_quickcrud_codegen (from versions: none) ERROR: No
> matching distribution found for fastapi_quickcrud_codegen (myenv) *@*.*:/tmp/fastapi-crud-template-generator-main$
> How do i fix this problem? Thanks On Thu, Nov 17, 2022 at 6:34 PM Srikanth
> Pokkuluri @.*> wrote:
> … <#m_-2770753459503668186_m_-2484583352249983500_>
>
> it should be pip install fastapi-crud-code-generator
>
> —
> Reply to this email directly, view it on GitHub
> <#29 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEGAGU5SKEQDPFIIQBP6IDLWIYWBPANCNFSM6AAAAAARZC3RSE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
sorry, your questions are a bit confusing and I don't understand it. please asking and showing the code. thanks |
Dear Sir,
I apologize for confused question.
I ran application
[image: image.png]
When clicking /test_1 Async Get Many
[image: image.png]
Execute is Failing
[image: image.png]
FROM "HLT_CLAIM_2020_2021_GOVTs"
2022-11-18 14:27:05,866 INFO sqlalchemy.engine.Engine [generated in
0.00081s] ()
_2020_2021_GOVTs"."dataCategory"
FROM "HLT_CLAIM_2020_2021_GOVTs"
2022-11-18 14:27:05,866 INFO sqlalchemy.engine.Engine [generated in
0.00081s] ()
*Killed*
*---------------------------------*
code below
from fastapi import FastAPI
from sqlalchemy import *
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import *
from fastapi_quickcrud.crud_router import crud_router_builder
Base = declarative_base()
metadata = Base.metadata
engine = create_async_engine('postgresql+asyncpg://
***@***.***/postgres', future=True, echo=True,
pool_use_lifo=True, pool_pre_ping=True,
pool_recycle=7200)
#engine = create_async_engine('postgresql://
***@***.***/postgres', future=True, echo=True,
# pool_use_lifo=True, pool_pre_ping=True,
pool_recycle=7200)
async_session = sessionmaker(bind=engine, class_=AsyncSession)
async def get_transaction_session() -> AsyncSession:
async with async_session() as session:
async with session.begin():
yield session
class HLTCLAIM20202021GOVT(Base):
__tablename__ = 'HLT_CLAIM_2020_2021_GOVTs'
__table_args__ = (
UniqueConstraint('TXT_INSURER_CODE', 'TXT_TRANSACTION_ID',
'LOAD_MONTH', 'RECONCILE_FLAG'),
)
id = Column(Integer, primary_key=True,
server_default=text("nextval('\"HLT_CLAIM_2020_2021_GOVTs_id_seq\"'::regclass)"))
TXT_TPA_CODE = Column(String(10))
TXT_INSURER_CODE = Column(String(10))
TXT_POLICY_NUMBER = Column(String(128))
TXT_MEMBER_REFERENCE_KEY = Column(String(128))
EMPLOYEE_ID = Column(String(128))
DATE_OF_BIRTH = Column(DateTime(True))
NUM_AGE_OF_INSURED = Column(Integer)
DATE_POLICY_START = Column(DateTime(True))
DATE_POLICY_END = Column(DateTime(True))
TXT_PRODUCT_TYPE = Column(String(128))
TXT_TYPE_OF_POLICY = Column(String(128))
BOO_FLOATER_APPLICABLE = Column(String(5))
TXT_GENDER = Column(String(10))
NUM_SUM_INSURED = Column(Numeric(30, 2))
TXT_CLAIM_NUMBER = Column(String(128))
TXT_DIAGNOSIS_CODE_LEVEL_I = Column(String(128))
TXT_PROCEDURE_CODE_LEVEL_I = Column(String(1000))
TXT_NAME_OF_THE_HOSPITAL = Column(String(8000))
TXT_REGISTRATION_NUMBER_OF_HOSPITAL = Column(String(128))
TXT_PAN_OF_HOSPITAL = Column(String(128))
TXT_PIN_CODE_OF_HOSPITAL = Column(String(20))
*.....*
dataCategory = Column(String(128), server_default=text("'govt'::character
varying"))
crud_route_1 = crud_router_builder(db_session=get_transaction_session,
db_model=HLTCLAIM20202021GOVT,
prefix="/test_1",
tags=["test_1"],
async_mode=True
)
app = FastAPI()
[app.include_router(i) for i in [crud_route_1]]
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8080)
Could you please suggest if i have to do any other settings or rewrite
program.
Regards,
…On Fri, Nov 18, 2022 at 2:19 PM Luis ***@***.***> wrote:
Dear Sir, I am trying to autogen from MS SQL Server But failing to create
classes with some security error I tried all combinations
sqlalchemy.exc.OperationalError: (pyodbc.OperationalError) ('08001',
'[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider:
[error:1416F086:SSL routines:tls_process_server_certificate:certificate
verify failed:self signed certificate] (-1) (SQLDriverConnect)') Any hint
what i should do? And when i ran crud.py application GetMany Its failing
022-11-18 11:13:16,771 INFO sqlalchemy.engine.Engine [generated in
0.00078s] (Decimal('50000'), Decimal('100000')) *2022-11-18 11:27:31,155
INFO sqlalchemy.engine.Engine COMMITKilled* (crudenv)
server:/tmp/fastapi-crud-template-generator-main$ Any suggestions. Because
the table size is very huge in crore records SO IS It failing becuase of
table size ? Please suggest and advice Thanks On Thu, Nov 17, 2022 at 7:39
PM Srikanth Pokkuluri *@*.***> wrote:
… <#m_3651164595974279333_>
sorry, your questions are a bit confusing and I don't understand it.
please asking and showing the code. thanks
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU6TBTJH2TQ2VTHHX3DWI47J3ANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I cannot see the the images from your comment, could you try to share the image by another way? |
Dear Sir,
I have attached the images.
Hope its visible now
Thanks a lot
…On Fri, Nov 18, 2022 at 3:56 PM Luis ***@***.***> wrote:
I cannot see the the images from your comment, could you try to share the
image by another way?
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU62DF64BLSPNPBNV6LWI5KTVANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
still cannot receive you image. Seems you are reply this issue(#29) by email, but GitHub did not support that receive attachment from email. I have tried you table schema. I create a table by your schema (change server_default to default with dummy data), and insert a dummy data, and request with get many api, all is works normally. |
Hi Sir
Again trying to use crud template main
I have to show only selected field for GET operation end point instead of
showing all fields
And search should retrieve in nanoseconds
Please advise how to modify and do
…On FridayHi Sir , November 18, 2022, Luis ***@***.***> wrote:
still cannot receive you image. Seems you are reply the issue(#29
<#29>) by email, but
GitHub seems not support attachment.
I have tried you table schema. I create a table by your schema, and insert
a dummy data, and request with get many api, all is works normally.
As I know is, you are try to request get many api, but some error is
raising up, you could share me the error trackback message
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU6IE6JVSWFTRNTMYLTWI5VUJANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
crud_methods argument in DbModel is supportting CrudMethods.FIND_ONE, it allow you to generate the find one api only, just like the following example in README
Then, the retrieval time(nano query) Is not on my design in this project since which involves many situations, such as sql index, hardware, network, sql statement. But you can try to update your own sql statement instead of generated code |
O.k Sir,
Thanks for the reply.
I will try and will update you for any more advice.
Thanks
…On Wed, Nov 30, 2022 at 9:30 AM Luis ***@***.***> wrote:
Hi Sir Again trying to use crud template main I have to show only selected
field for GET operation end point instead of showing all fields And search
should retrieve in nanoseconds Please advise how to modify and do
… <#m_5944927955836635849_>
crud_methods argument in DbModel is supportting CrudMethods.FIND_ONE, it
allow you to generate the find one api only, just like the following
example in README
from fastapi_quickcrud_codegen.db_model import DbModel
from fastapi_quickcrud_codegen.misc.type import CrudMethods
from fastapi_quickcrud_codegen import crud_router_builder
model_list = [DbModel(db_model=SampleTableTwo, prefix="/my_second_api", tags=["sample api"],
exclude_columns=['bytea_value'],crud_methods=[CrudMethods.FIND_ONE])]
crud_router_builder(
db_model_list=model_list,
is_async=False,
database_url="sqlite://"
)
Then, the retrieval time(nano query) Is not on my design in this project
since which involves many situations, such as sql index, hardware, network,
sql statement. But you can try to update your own sql statement instead of
generated code
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGAGU7BAC6W7QVQTFHNUDDWK3GN5ANCNFSM6AAAAAARZC3RSE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Dear Sir,
I have installed the FastAPIQuickCRUD and also generator.
BUT How to run and which path IS NOT clear in the README File.
Please guide
Also Where should the user setup the variable SQLALCHEMY
Please reply
Regards,
The text was updated successfully, but these errors were encountered: