public static List <SqliteTable> ToSqlite(List <MssqlTable> tableList) { List <SqliteTable> returnValue = new List <SqliteTable>(); foreach (var mssqlTable in tableList) { SqliteTable sqliteTable = new SqliteTable(); sqliteTable.Name = mssqlTable.Name; sqliteTable.FieldList = new List <SqLiteField>(); foreach (var mssqlField in mssqlTable.FieldList) { SqLiteField sqliteField = new SqLiteField(); sqliteField.Name = mssqlField.Name; sqliteField.DataType = GetSqliteFieldType(mssqlField.ColType); sqliteField.IsPrimaryKey = mssqlField.IsPrimaryKey; sqliteField.IsIdentity = mssqlField.IsIdentity; sqliteTable.FieldList.Add(sqliteField); } returnValue.Add(sqliteTable); } return(returnValue); }
public async Task Test_Binding_OfEnumerateAsyncWithMultipleSets() { SqliteTable table1 = new SqliteTable("Item") { new object[] { 1 }, new object[] { 2 }, new object[] { 3 }, }; SqliteTable table2 = new SqliteTable("Item") { new object[] { 4 }, new object[] { 5 }, new object[] { 6 }, }; DatabaseHelper.Default.Enumerate <int>(table1, table2).ShouldBe(new[] { 1, 2, 3, 4, 5, 6 }); (await(DatabaseHelper.Default.EnumerateAsync <int>(table1, table2)).ToList()).ShouldBe(new[] { 1, 2, 3, 4, 5, 6 }); }
public async Task Test_Binding_OfNestedStructs() { SqliteTable table = new SqliteTable("Item.Integer", "Item.String", "Item.Sub.Value") { new object[] { 1, "Jerrycurl", 2 }, }; BigStruct result1 = DatabaseHelper.Default.Query <BigStruct>(table).FirstOrDefault(); BigStruct result2 = (await DatabaseHelper.Default.QueryAsync <BigStruct>(table)).FirstOrDefault(); result1.Integer.ShouldBe(1); result2.Integer.ShouldBe(1); result1.String.ShouldBe("Jerrycurl"); result2.String.ShouldBe("Jerrycurl"); result1.Sub.Value.ShouldBe(2); result2.Sub.Value.ShouldBe(2); }
public async Task Test_Binding_OfResultSetWithoutMatchingColumns() { SqliteTable table = new SqliteTable("X") { new object[] { 1 }, new object[] { 2 } }; IList <BigAggregate> result1 = DatabaseHelper.Default.Query <BigAggregate>(table); IList <BigAggregate> result2 = await DatabaseHelper.Default.QueryAsync <BigAggregate>(table); IList <BigModel> result3 = DatabaseHelper.Default.Query <BigModel>(table); IList <BigModel> result4 = await DatabaseHelper.Default.QueryAsync <BigModel>(table); IList <BigModel> result5 = DatabaseHelper.Default.Enumerate <BigModel>(table).ToList(); result1.ShouldBeEmpty(); result2.ShouldBeEmpty(); result3.ShouldBeEmpty(); result4.ShouldBeEmpty(); result5.ShouldBe(new[] { (BigModel)null, null }); }
public Tree(SqliteClient Client) { this.Client = Client; this.FileEntryTable = Client.Table <FileEntry>("FileEntry"); this.FileReferenceTable = Client.Table <FileReference>("FileReference"); }
public Tree(SqliteClient Client) { this.Client = Client; this.FileEntryTable = Client.Table<FileEntry>("FileEntry"); this.FileReferenceTable = Client.Table<FileReference>("FileReference"); }
public Start() { _sqliteTable = new SqliteTable(); _sqliteService = new SqliteService(); }