Using C# with non-SQLite databases (such as SQL Server, Oracle, etc), you can loop through the DataTable returned from DbConnection.GetSchema("DataTypes") to look at all the supported data types of that database.
Unfortunately, Microsoft.Data.Sqlite.SqliteConnection does not support the GetSchema() method. So, how can I programmatically list all the supported data types in a SQLite database?
In order to programatically determine all data types used in a particular SQLite database schema, you can leverage the sqlite_master
table in conjunction with a pragma statement for each table.
In two steps:
select tbl_name from sqlite_master where type = 'table';
pragma table_info(tbl_name);
Use the returned type
column to build your unique list of date types used across the entire database.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.