trying to create a custome dialect did not find proper step guide

19 views
Skip to first unread message

sayak chakraborty

unread,
Apr 7, 2023, 1:03:19 AM4/7/23
to sqlalchemy
create a custom SQLAlchemy  dialect, called PCRRESTapiDialect for SQL Alchemy that can call a rest api and return result as a table.
i am trying to achive this but i dont find  any solution

Jonathan Vanasco

unread,
Apr 7, 2023, 1:42:14 PM4/7/23
to sqlalchemy
Most custom dialects are written by forking an existing dialect.

Unfortunately, a dialect can not accomplish what you want to do.

SqlAlchemy Dialects are used to generate SQL, which is then passed to the database via a DBAPI driver.

For example, when someone uses PostgreSQL with SQLAlchemy, they use the SQLAlchemy postgresql dialect AND their choice of a DBAPI driver (which could be any one of psycopg2, psycopg 3, pg8000, asyncpg, psycopg2cffi, etc)

There are a few independent projects that developed REST solutions by writing both a dialect AND a DBAPI driver into a single package.

Examples include:

You will need to implement a solution similar to one of the above projects.

If you look at the table of known dialects - https://docs.sqlalchemy.org/en/20/dialects/index.html - you may find other projects that implemented dialect+dbapi drivers in a single package.

sayak chakraborty

unread,
Apr 7, 2023, 11:41:30 PM4/7/23
to sqlalchemy
Thank you sir for your response ,can you please guide me about how to create a customs dialect because in sqlalchemy i find a topic on 3rd party dialect but i dont fine and proper guide for it if you can please can you provide me guide.

Jonathan Vanasco

unread,
Apr 12, 2023, 4:29:06 PM4/12/23
to sqlalchemy
There are no guides, because this is a very advanced topic.

If you are unable to code this based on the examples I shared above, you will have to find someone who can.
Reply all
Reply to author
Forward
0 new messages