You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Sqlite version of Massive, the Schema property returns a CREATE TABLE string. It is certainly possible to parse it to get similar data as is returned from the Sql Server version of Massive. However, the following code will return column names and types like the Sql Server version of Massive:
IEnumerable<dynamic> _schema;
public IEnumerable<dynamic> Schema
{
get
{
if (_schema == null) {
var rows = new List<dynamic>();
foreach (var row in Query("PRAGMA table_info('" + TableName + "')")) {
rows.Add(new {
COLUMN_NAME = (row as IDictionary<string,object>)["name"].ToString(),
DATA_TYPE = (row as IDictionary<string,object>)["type"].ToString(),
IS_NULLABLE = (row as IDictionary<string,object>)["notnull"].ToString() == "0" ? "NO" : "YES",
});
}
_schema = rows;
}
return _schema;
}
}
The text was updated successfully, but these errors were encountered:
In the Sqlite version of Massive, the Schema property returns a CREATE TABLE string. It is certainly possible to parse it to get similar data as is returned from the Sql Server version of Massive. However, the following code will return column names and types like the Sql Server version of Massive:
The text was updated successfully, but these errors were encountered: