python - sqlite3 and cursor.description -


When using the sqlite3 module in Python, all elements of the cursor are set to none except the column names, so This tube can not be used to find column type for a query result (as opposed to other DB-API compliant modules). To get the details of the table, use the pragma table_info (table_name) .fetchall () is the only way to get the type of columns, store it in memory, and then from the cursor to the column names Meet the details of the overall table details?

No, this is not the only way. Alternatively, you can get a line, repeat it again, and individual columns can observe python objects and types. Unless the value is (which is the SQL field tap in that case), it should give you a fairly accurate signal of what the database column type was.

sqlite3 only uses sqlite3_column_decltype and is accessible to sqlite3_column_type in one place, not each, and neither the Python application - hence their " Direct "way you are searching.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -