Thank you for your response and I am immediately interested in your
articles.
17 Mart 2021 Çarşamba tarihinde saat 20:46:11 UTC+3 itibarıyla Simon King
şunları yazdı:
> OK, I see. You're creating tables dynamically, and you want to be able
> to insert data into those tables.
>
> I think it'll
OK, I see. You're creating tables dynamically, and you want to be able
to insert data into those tables.
I think it'll be easier to use SQLAlchemy Core for this, rather than
the ORM. You can use reflection to load table definitions from the
database.
I updated sqlalchemy and now I get an error when accessing the database.
And their codes need to be coded:
What I really wanted to do was add data to a table with json data in the /
main / write path. but now I get an error when I send / main / new-app post
request (I updated sqlalchemy and it
I assumed you were defining classes corresponding to your database
tables, as shown here:
https://docs.sqlalchemy.org/en/14/orm/tutorial.html#declare-a-mapping
If that's not how you're using SQLAlchemy, you'll have to show your code.
Simon
On Wed, Mar 17, 2021 at 2:07 PM FURKAN bilgin wrote:
I think we keep it in RAM in the first method, so it may be a problem if
the program is restarted. and I guess I don't understand what you mean by
Base class.
17 Mart 2021 Çarşamba tarihinde saat 14:27:31 UTC+3 itibarıyla Simon King
şunları yazdı:
> There are lots of ways of doing this. One
There are lots of ways of doing this. One option is to provide a
dictionary when creating your declarative_base:
classes = {}
Base = declarative_base(class_registry=classes)
Now you can look up classes by name in that classes dictionary:
def get_table_by_name(name):
return
*table_name = "table_name"*
*#get table as table*
*new = table(**tablo)db.session.add(table)db.session.commit()*
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable