Example #1
0
 public NovaQuery(INovaDb db, NovaTable table, string tableName, string action, string identity = null)
 {
     _db        = db;
     _table     = table;
     _tableName = tableName;
     _action    = action;
     _identity  = identity;
 }
Example #2
0
 public NovaQuery(INovaDb db, NovaTable table, INovaQuery tableQuery, string action, string identity = null)
 {
     _db         = db;
     _table      = table;
     _tableName  = tableQuery.BuildString();
     _queryTable = true;
     _action     = action;
     _identity   = identity;
 }
Example #3
0
        public void Init()
        {
            SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder();
            csb.InitialCatalog = "TestDB";
            csb.Password = "******";
            csb.UserID = "sa";
            csb.DataSource = "localhost";

            _sut = new NovaDb(csb.ToString());

            if (_sut.TableExists(_testTable))
            {
                _sut.Drop(_testTable).Execute();
            }

            _sut.Create(_testTable)
                    .Column("id", "int IDENTITY(1,1)")
                    .Column("col1", "integer", false)
                    .Column("col2", "nvarchar(255)", false)
                    .Execute();

            _table = _sut.Table(_testTable, "id");
        }
Example #4
0
        public void Init()
        {
            SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder();

            csb.InitialCatalog = "TestDB";
            csb.Password       = "******";
            csb.UserID         = "sa";
            csb.DataSource     = "localhost";

            _sut = new NovaDb(csb.ToString());

            if (_sut.TableExists(_testTable))
            {
                _sut.Drop(_testTable).Execute();
            }

            _sut.Create(_testTable)
            .Column("id", "int IDENTITY(1,1)")
            .Column("col1", "integer", false)
            .Column("col2", "nvarchar(255)", false)
            .Execute();

            _table = _sut.Table(_testTable, "id");
        }