What is the sqlalchemy equivalent column type for 'money' and 'OID' column types in Postgres?
This SQLAlchemy engine is a global object which can be created and configured once and use the same engine object multiple times for different operations. The first step in establishing a connection with the PostgreSQL database is creating an engine object using the create_engine() function of SQLAlchemy.
server_default is specifically the SQL text that one would specify in the "DEFAULT" section of a "CREATE TABLE" statement, and SQLAlchemy has no special expectations in this area, it accepts SQL text like any other non-expression portion where a string is sent.
create_all() function to create the tables that are associated with your models. In this case you only have one model, which means that the function call will only create one table in your database: from app import db, Student.
from the argument on this link The final conclusion was:
Using FLOAT for monetary amounts is an extremely bad idea because of the inexactness of storage and arithmetic .. Using MONEY is discouraged because it is too locale-sensitive NUMERIC should be used instead
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With