private void DropCreateTestTables() { string propertyTableSql = "" + "CREATE TABLE Property (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name text, Address text)"; _db.TryDropTable("Property"); _db.TransactDDL(propertyTableSql); string BuildingTableSql = "" + "CREATE TABLE Building ( BIN text PRIMARY KEY NOT NULL, Identifier text, PropertyId int )"; _db.TryDropTable("Building"); if (!_db.TableExists("Building")) { _db.TransactDDL(BuildingTableSql); } string UnitTableSql = "" + "CREATE TABLE unit ( unit_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, BIN TEXT, unit_no TEXT )"; _db.TryDropTable("unit"); _db.TransactDDL(UnitTableSql); string WorkOrderTableSql = "" + "CREATE TABLE wk_order ( wo_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, desc text)"; _db.TryDropTable("wk_order"); _db.TransactDDL(WorkOrderTableSql); }
public void Creates_table_with_string_id() { // The Guitar test object has a string field named simply SKU. This will not be matched // without an attribute decoration, and horrible plague and pesilence will result. _db.TryDropTable("guitardocuments"); var guitarstore = new SqliteDocumentStore <GuitarDocuments>(_db); bool exists = _db.TableExists(guitarstore.TableName); Assert.IsTrue(exists); }
public override void DropCreateAll() { const string SQL_TRACKS_TABLE = "" + "CREATE TABLE Track ( TrackId INTEGER PRIMARY KEY AUTOINCREMENT, AlbumId INT NOT NULL, Name text NOT NULL, Composer TEXT );"; const string SQL_ARTISTS_TABLE = "" + "CREATE TABLE Artist ( ArtistId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name TEXT NOT NULL );"; const string SQL_ALBUMS_TABLE = "" + "CREATE TABLE Album ( AlbumId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ArtistId INT NOT NULL, Title text NOT NULL );"; _db.TryDropTable("Artist"); _db.TryDropTable("Album"); _db.TryDropTable("Track"); _db.TryDropTable("artistdocuments"); int result = _db.TransactDDL(SQL_ARTISTS_TABLE + SQL_ALBUMS_TABLE + SQL_TRACKS_TABLE); }
private void DropCreateTestTables() { string UnitTableSql = "" + "CREATE TABLE unit ( unit_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, BIN TEXT, unit_no TEXT )"; _db.TryDropTable("unit"); _db.TransactDDL(UnitTableSql); }
private void DropCreateTestTables() { string propertyTableSql = "" + "CREATE TABLE Property (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name text, Address text)"; _db.TryDropTable("Property"); _db.TransactDDL(propertyTableSql); }
private void DropCreateTestTables() { string WorkOrderTableSql = "" + "CREATE TABLE wk_order ( wo_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \"desc\" text)"; _db.TryDropTable("wk_order"); _db.TransactDDL(WorkOrderTableSql); }
public void Creates_table_with_int_id() { // The Widget test object has an int field named Identifier. This will not be matched // without an attribute decoration, and horrible plague and pesilence will result. Also, // the attribute IsAuto property is set to false, so the field will NOT be a serial key. _db.TryDropTable("widgetdocuments"); var widgetstore = new SqliteDocumentStore <WidgetDocuments>(_db); bool exists = _db.TableExists(widgetstore.TableName); Assert.IsTrue(exists); }
private void DropCreateTestTables() { string BuildingTableSql = "" + "CREATE TABLE Building ( BIN text PRIMARY KEY NOT NULL, Identifier text, PropertyId int )"; _db.TryDropTable("Building"); if (!_db.TableExists("Building")) { _db.TransactDDL(BuildingTableSql); } }
public void Creates_table_with_serial_id() { // The Company test object has an int field named simply "Id". Without any // Attribute decoration, this should result in a table with a serial int PK. // NOTE: Gotta go look to see if the field is a serial in or not... //var db = new CommandRunner("chinook"); _db.TryDropTable("companydocuments"); var companyStore = new SqliteDocumentStore <CompanyDocuments>(_db); bool exists = _db.TableExists(companyStore.TableName); Assert.IsTrue(exists); }
public override void DropCreateAll(bool forceDropCreateTables) { if (!forceDropCreateTables) { return; } const string urlItemSql = @" CREATE TABLE UrlItem ( Id INTEGER PRIMARY KEY AUTOINCREMENT , CustomUrl VARCHAR(1000) , OriginUrl VARCHAR(2000) NOT NULL , ExpireInDays DOUBLE NOT NULL , ExpireMode SMALLINT NOT NULL , CreatedOn DATETIME NOT NULL );"; const string urlHitSql = @" CREATE TABLE UrlHit ( Id INTEGER PRIMARY KEY AUTOINCREMENT , UrlItemId INTEGER , ClientIp VARCHAR(45) , HitOn DATETIME NOT NULL );"; if (_db.TableExists("UrlItem")) { _db.TryDropTable("UrlItem"); } if (_db.TableExists("UrlHit")) { _db.TryDropTable("UrlHit"); } _db.TransactDDL(urlItemSql); _db.TransactDDL(urlHitSql); }
public void Inserts_record_with_string_id() { _db.TryDropTable("instrumentdocuments"); var InstrumentStore = new SqliteDocumentStore <InstrumentDocuments>(_db); var newInstrument = new InstrumentDocuments { Id = "USA123", Category = "String", Type = "Guitar" }; InstrumentStore.Add(newInstrument); var foundInstrument = InstrumentStore.TryLoadData().FirstOrDefault(); Assert.IsTrue(foundInstrument != null && foundInstrument.Id == "USA123"); }
public void init() { _db = new SqliteDbCore("BiggyTest"); _db.TryDropTable("propertydocuments"); _PropertyDocumentStore = _db.CreateDocumentStoreFor<PropertyDocument>(); }
public void init() { _db = new SqliteDbCore("BiggyTest"); _db.TryDropTable("propertydocuments"); _PropertyDocumentStore = _db.CreateDocumentStoreFor <PropertyDocument>(); }