当前位置: 首页>>代码示例>>C#>>正文


C# TableInfo.AddColumn方法代码示例

本文整理汇总了C#中TableInfo.AddColumn方法的典型用法代码示例。如果您正苦于以下问题:C# TableInfo.AddColumn方法的具体用法?C# TableInfo.AddColumn怎么用?C# TableInfo.AddColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TableInfo的用法示例。


在下文中一共展示了TableInfo.AddColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SessionTableContainer

        static SessionTableContainer()
        {
            // SYSTEM.OPEN_SESSIONS
            OpenSessionsTableInfo = new TableInfo(SystemSchema.OpenSessionsTableName);
            OpenSessionsTableInfo.AddColumn("username", PrimitiveTypes.String());
            OpenSessionsTableInfo.AddColumn("host_string", PrimitiveTypes.String());
            OpenSessionsTableInfo.AddColumn("last_command", PrimitiveTypes.DateTime());
            OpenSessionsTableInfo.AddColumn("time_connected", PrimitiveTypes.DateTime());
            OpenSessionsTableInfo = OpenSessionsTableInfo.AsReadOnly();

            // SYSTEM.SESSION_INFO
            SessionInfoTableInfo = new TableInfo(SystemSchema.SessionInfoTableName);
            SessionInfoTableInfo.AddColumn("var", PrimitiveTypes.String());
            SessionInfoTableInfo.AddColumn("value", PrimitiveTypes.String());
            SessionInfoTableInfo = SessionInfoTableInfo.AsReadOnly();

            // SYSTEM.STATS
            StatisticsTableInfo = new TableInfo(SystemSchema.StatisticsTableName);
            StatisticsTableInfo.AddColumn("stat_name", PrimitiveTypes.String());
            StatisticsTableInfo.AddColumn("value", PrimitiveTypes.String());
            StatisticsTableInfo = StatisticsTableInfo.AsReadOnly();

            IntTableInfo = new TableInfo[3];
            IntTableInfo[0] = StatisticsTableInfo;
            IntTableInfo[1] = SessionInfoTableInfo;
            IntTableInfo[2] = OpenSessionsTableInfo;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:27,代码来源:SessionTableContainer.cs

示例2: CreateAdminSession

        protected override ISession CreateAdminSession(IDatabase database)
        {
            using (var session = base.CreateAdminSession(database)) {
                using (var query = session.CreateQuery()) {
                    var tn1 = ObjectName.Parse("APP.test_table1");
                    var tableInfo1 = new TableInfo(tn1);
                    tableInfo1.AddColumn(new ColumnInfo("id", PrimitiveTypes.Integer()));
                    tableInfo1.AddColumn(new ColumnInfo("name", PrimitiveTypes.String()));
                    tableInfo1.AddColumn(new ColumnInfo("date", PrimitiveTypes.DateTime()));
                    query.CreateTable(tableInfo1);
                    query.AddPrimaryKey(tn1, "id");

                    var tn2 = ObjectName.Parse("APP.test_table2");
                    var tableInfo2 = new TableInfo(tn2);
                    tableInfo2.AddColumn(new ColumnInfo("id", PrimitiveTypes.Integer()));
                    tableInfo2.AddColumn(new ColumnInfo("other_id", PrimitiveTypes.Integer()));
                    tableInfo2.AddColumn(new ColumnInfo("count", PrimitiveTypes.Integer()));
                    query.CreateTable(tableInfo2);
                    query.AddPrimaryKey(tn2, "id");
                    query.AddForeignKey(tn2, new[] { "other_id" }, tn1, new[] { "id" }, ForeignKeyAction.Cascade, ForeignKeyAction.Cascade, null);

                    query.Commit();
                }
            }

            return base.CreateAdminSession(database);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:27,代码来源:DropTableTests.cs

示例3: CreateSimpleTableAsAdmin

        public void CreateSimpleTableAsAdmin()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var tableInfo = new TableInfo(tableName);
            tableInfo.AddColumn("a", PrimitiveTypes.Integer(), true);
            tableInfo.AddColumn("b", PrimitiveTypes.String());

            using (var session = Database.CreateUserSession(AdminUserName, AdminPassword)) {
                using (var context = new SessionQueryContext(session)) {
                    Assert.DoesNotThrow(() => {
                        context.CreateTable(tableInfo);
                    });
                }

                Assert.DoesNotThrow(() => session.Commit());
            }

            using (var session = Database.CreateUserSession(AdminUserName, AdminPassword)) {
                using (var context = new SessionQueryContext(session)) {
                    bool exists = false;
                    Assert.DoesNotThrow(() => exists = context.TableExists(tableName));
                    Assert.IsTrue(exists);
                }
            }
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:25,代码来源:TableTests.cs

示例4: CreateTable

 private void CreateTable(IQuery query)
 {
     var tableInfo = new TableInfo(ObjectName.Parse("APP.test_table"));
     tableInfo.AddColumn("a", PrimitiveTypes.Integer());
     tableInfo.AddColumn("b", PrimitiveTypes.String(), false);
     query.CreateTable(tableInfo, false, false);
 }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:OpenStatementTests.cs

示例5: TestSetup

        public void TestSetup()
        {
            var tableInfo = new TableInfo(ObjectName.Parse("APP.people"));
            tableInfo.AddColumn("id", PrimitiveTypes.Bit());
            tableInfo.AddColumn("first_name", PrimitiveTypes.String(), true);
            tableInfo.AddColumn("last_name", PrimitiveTypes.String());
            tableInfo.AddColumn("age", PrimitiveTypes.TinyInt());
            table = new TemporaryTable(tableInfo);

            var tempTable = (TemporaryTable) table;
            tempTable.NewRow(new[] {
                DataObject.BigInt(1),
                DataObject.String("Antonello"),
                DataObject.String("Provenzano"),
                DataObject.Null()
            });
            tempTable.NewRow(new[] {
                DataObject.BigInt(2),
                DataObject.String("Moritz"),
                DataObject.String("Krull"),
                DataObject.TinyInt(31)
            });

            tempTable.BuildIndexes();
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:25,代码来源:TableQueryTests.cs

示例6: CreateQuery

 protected override IQuery CreateQuery(ISession session)
 {
     var query = base.CreateQuery(session);
     var tableInfo = new TableInfo(TestTableName);
     tableInfo.AddColumn("id", PrimitiveTypes.Integer());
     tableInfo.AddColumn("name", PrimitiveTypes.String());
     tableInfo.AddColumn("date", PrimitiveTypes.DateTime());
     query.CreateTable(tableInfo);
     return query;
 }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:10,代码来源:TriggerTests.cs

示例7: CreateQueryContext

        protected override IQueryContext CreateQueryContext(IDatabase database)
        {
            var context = base.CreateQueryContext(database);

            var tableInfo = new TableInfo(TestTableName);
            tableInfo.AddColumn("id", PrimitiveTypes.Integer());
            tableInfo.AddColumn("name", PrimitiveTypes.String());
            tableInfo.AddColumn("date", PrimitiveTypes.DateTime());

            return context;
        }
开发者ID:furesoft,项目名称:deveeldb,代码行数:11,代码来源:TriggerTests.cs

示例8: OnSetUp

        protected override bool OnSetUp(string testName, IQuery query)
        {
            if (testName != "RollbackTableCreate") {
                var tableInfo = new TableInfo(ObjectName.Parse("APP.test_table"));
                tableInfo.AddColumn("a", PrimitiveTypes.Integer());
                tableInfo.AddColumn("b", PrimitiveTypes.String());
                query.Access().CreateObject(tableInfo);
            }

            return true;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:11,代码来源:RollbackTests.cs

示例9: CreateTable

        private IMutableTable CreateTable()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var tableInfo = new TableInfo(tableName);
            tableInfo.AddColumn("name", PrimitiveTypes.String(), true);
            tableInfo.AddColumn("age", PrimitiveTypes.Integer());
            tableInfo.AddColumn("order", PrimitiveTypes.Integer());

            Query.CreateTable(tableInfo);
            return Query.GetMutableTable(tableName);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:11,代码来源:MutableTableTests.cs

示例10: CreateTableInfo

        private static TableInfo CreateTableInfo(string schema, string name)
        {
            var tableInfo = new TableInfo(new ObjectName(new ObjectName(schema), name));

            tableInfo.AddColumn("type", PrimitiveTypes.Numeric());
            tableInfo.AddColumn("on_object", PrimitiveTypes.String());
            tableInfo.AddColumn("routine_name", PrimitiveTypes.String());
            tableInfo.AddColumn("param_args", PrimitiveTypes.String());
            tableInfo.AddColumn("owner", PrimitiveTypes.String());

            return tableInfo.AsReadOnly();
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:12,代码来源:TriggersTableContainer.cs

示例11: Create

        public void Create()
        {
            var tableInfo = new TableInfo(SystemSchema.ViewTableName);
            tableInfo.AddColumn("schema", PrimitiveTypes.String());
            tableInfo.AddColumn("name", PrimitiveTypes.String());
            tableInfo.AddColumn("query", PrimitiveTypes.String());
            tableInfo.AddColumn("plan", PrimitiveTypes.Binary());

            // TODO: Columns...

            Transaction.CreateTable(tableInfo);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:12,代码来源:ViewManager.cs

示例12: Create

 public void Create()
 {
     // SYSTEM.SCHEMA_INFO
     var tableInfo = new TableInfo(SystemSchema.SchemaInfoTableName);
     tableInfo.AddColumn("id", PrimitiveTypes.Numeric());
     tableInfo.AddColumn("name", PrimitiveTypes.String());
     tableInfo.AddColumn("type", PrimitiveTypes.String());
     tableInfo.AddColumn("culture", PrimitiveTypes.String());
     tableInfo.AddColumn("other", PrimitiveTypes.String());
     tableInfo = tableInfo.AsReadOnly();
     Transaction.CreateTable(tableInfo);
 }
开发者ID:prepare,项目名称:deveeldb,代码行数:12,代码来源:SchemaManager.cs

示例13: OnTableCompositeCreate

        public void OnTableCompositeCreate(IQuery systemQuery)
        {
            var tableInfo = new TableInfo(ViewManager.ViewTableName);
            tableInfo.AddColumn("schema", PrimitiveTypes.String());
            tableInfo.AddColumn("name", PrimitiveTypes.String());
            tableInfo.AddColumn("query", PrimitiveTypes.String());
            tableInfo.AddColumn("plan", PrimitiveTypes.Binary());

            // TODO: Columns...

            systemQuery.Access().CreateTable(tableInfo);
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:12,代码来源:ViewsInit.cs

示例14: CreateSimple_RegularUser

        public void CreateSimple_RegularUser()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var tableInfo = new TableInfo(tableName);
            tableInfo.AddColumn("a", PrimitiveTypes.Integer(), true);
            tableInfo.AddColumn("b", PrimitiveTypes.String());

            using (var session = CreateUserSession(TestUserName, TestPassword)) {
                using (var query = session.CreateQuery()) {
                    Assert.DoesNotThrow(() => query.CreateTable(tableInfo));
                }
            }
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:13,代码来源:CreateTableTests.cs

示例15: CreateTestView

        private void CreateTestView(IQuery query)
        {
            var tn1 = ObjectName.Parse("APP.test_table1");
            var tableInfo1 = new TableInfo(tn1);
            tableInfo1.AddColumn(new ColumnInfo("id", PrimitiveTypes.Integer()));
            tableInfo1.AddColumn(new ColumnInfo("name", PrimitiveTypes.String()));
            tableInfo1.AddColumn(new ColumnInfo("date", PrimitiveTypes.DateTime()));
            query.CreateTable(tableInfo1);
            query.AddPrimaryKey(tn1, "id");

            var exp = SqlExpression.Parse("SELECT * FROM APP.test_table1");
            query.ExecuteCreateView("APP.test_view1", (SqlQueryExpression) exp);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:13,代码来源:DropViewStatementTests.cs


注:本文中的TableInfo.AddColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。