本文整理汇总了C#中IQuery.Access方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.Access方法的具体用法?C# IQuery.Access怎么用?C# IQuery.Access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuery
的用法示例。
在下文中一共展示了IQuery.Access方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
private static void Create(IQuery systemQuery)
{
// SYSTEM.ROUTINE
systemQuery.Access()
.CreateTable(table => table
.Named(RoutineManager.RoutineTableName)
.WithColumn("id", PrimitiveTypes.Numeric())
.WithColumn("schema", PrimitiveTypes.String())
.WithColumn("name", PrimitiveTypes.String())
.WithColumn("type", PrimitiveTypes.String())
.WithColumn("location", PrimitiveTypes.String())
.WithColumn("body", PrimitiveTypes.Binary())
.WithColumn("return_type", PrimitiveTypes.String())
.WithColumn("username", PrimitiveTypes.String()));
// SYSTEM.ROUTINE_PARAM
systemQuery.Access().CreateTable(table => table
.Named(RoutineManager.RoutineParameterTableName)
.WithColumn("routine_id", PrimitiveTypes.Numeric())
.WithColumn("arg_name", PrimitiveTypes.String())
.WithColumn("arg_type", PrimitiveTypes.String())
.WithColumn("arg_attrs", PrimitiveTypes.Numeric())
.WithColumn("in_out", PrimitiveTypes.Integer())
.WithColumn("offset", PrimitiveTypes.Integer()));
}
示例2: OnTearDown
protected override bool OnTearDown(string testName, IQuery query)
{
var tableName = ObjectName.Parse("APP.test_table");
query.Access().DropAllTableConstraints(tableName);
query.Access().DropObject(DbObjectType.Table, tableName);
return true;
}
示例3: CreateSystemRoles
private static void CreateSystemRoles(IQuery query)
{
query.Access().CreateRole(SystemRoles.SecureAccessRole);
query.Access().CreateRole(SystemRoles.UserManagerRole);
query.Access().CreateRole(SystemRoles.SchemaManagerRole);
query.Access().CreateRole(SystemRoles.LockedRole);
}
示例4: OnTearDown
protected override bool OnTearDown(string testName, IQuery query)
{
var viewName = ObjectName.Parse("APP.text_view1");
query.Access().DropObject(DbObjectType.View, viewName);
query.Access().DropObject(DbObjectType.Table, ObjectName.Parse("APP.test_table"));
return true;
}
示例5: OnTearDown
protected override bool OnTearDown(string testName, IQuery query)
{
var tableName = ObjectName.Parse("APP.test_table");
query.Access().RevokeAllGrantsOn(DbObjectType.Table, tableName);
query.Access().DropRole("test_role");
query.Access().DeleteUser("test_user");
query.Access().DropObject(DbObjectType.Table, tableName);
return true;
}
示例6: OnSetUp
protected override bool OnSetUp(string testName, IQuery query)
{
query.Access().CreateUser("test_user", "0123456789");
query.Access().CreateRole("test_role1");
query.Access().CreateRole("role2");
if (testName == "Unlock")
query.Access().SetUserStatus("test_user", UserStatus.Locked);
return true;
}
示例7: OnTearDown
protected override bool OnTearDown(string testName, IQuery query)
{
query.Access().DeleteUser("test_user");
query.Access().DropRole("test_role");
var tableName1 = ObjectName.Parse("APP.test_table");
var tableName2 = ObjectName.Parse("APP.test_table2");
query.Access().DropAllTableConstraints(tableName1);
query.Access().DropObject(DbObjectType.Table, tableName1);
query.Access().DropObject(DbObjectType.Table, tableName2);
return true;
}
示例8: OnSetUp
protected override bool OnSetUp(string testName, IQuery query)
{
var tableName = ObjectName.Parse("APP.test_table");
query.Access().CreateTable(table => table
.Named(tableName)
.WithColumn("id", PrimitiveTypes.Integer()));
query.Access().CreateUser("test_user", "0123456789");
query.Access().GrantOnTable(tableName, "test_user", Privileges.Alter);
query.Access().CreateRole("test_role");
query.Access().AddUserToRole("test_user", "test_role");
return true;
}
示例9: OnSetUp
protected override bool OnSetUp(string testName, IQuery query)
{
var seqName = ObjectName.Parse("APP.seq1");
query.Access().CreateObject(new SequenceInfo(seqName, new SqlNumber(0), new SqlNumber(1), new SqlNumber(0),
new SqlNumber(Int16.MaxValue), 256));
return true;
}
示例10: CreateTable
private void CreateTable(IQuery query)
{
var tableName = ObjectName.Parse("APP.test_table");
query.Access().CreateTable(table => table
.Named(tableName)
.WithColumn(column => column
.Named("id")
.HavingType(PrimitiveTypes.Integer())
.WithDefault(SqlExpression.FunctionCall("UNIQUEKEY", new SqlExpression[] {
SqlExpression.Constant(tableName.FullName)
})))
.WithColumn("a", PrimitiveTypes.Integer())
.WithColumn("b", PrimitiveTypes.String()));
query.Access().AddPrimaryKey(tableName, "id", "PK_TEST_TABLE");
}
示例11: CreateTable
private void CreateTable(IQuery query)
{
query.Access().CreateTable(table => table
.Named("APP.test_table")
.WithColumn("a", PrimitiveTypes.Integer())
.WithColumn("b", PrimitiveTypes.String()));
}
示例12: InsertData
private void InsertData(IQuery query)
{
var tableName = ObjectName.Parse("APP.persons");
var table = query.Access().GetMutableTable(tableName);
var row = table.NewRow();
row["name"] = Field.String("Antonello Provenzano");
row["age"] = Field.Integer(36);
row.SetDefault(query);
table.AddRow(row);
row = table.NewRow();
row["name"] = Field.String("Sebastiano Provenzano");
row["age"] = Field.Integer(35);
row.SetDefault(query);
table.AddRow(row);
row = table.NewRow();
row["name"] = Field.String("Mart Rosmaa");
row["age"] = Field.Integer(33);
row.SetDefault(query);
table.AddRow(row);
row = table.NewRow();
row["name"] = Field.String("Karl Inge Stensson");
row["age"] = Field.Integer(54);
row.SetDefault(query);
table.AddRow(row);
}
示例13: OnSetUp
protected override bool OnSetUp(string testName, IQuery query)
{
var seqName = ObjectName.Parse("APP.seq1");
query.Access().CreateObject(new SequenceInfo(seqName, SqlNumber.Zero, SqlNumber.One, SqlNumber.Zero,
new SqlNumber(Int64.MaxValue), Int32.MaxValue));
return true;
}
示例14: CreateFunction
private void CreateFunction(IQuery query)
{
var functionName = ObjectName.Parse("APP.func1");
var body = new PlSqlBlockStatement();
body.Statements.Add(new ReturnStatement(SqlExpression.Constant(200)));
var functionInfo = new PlSqlFunctionInfo(functionName, new RoutineParameter[0], PrimitiveTypes.Integer(), body);
query.Access().CreateRoutine(functionInfo);
}
示例15: OnSetUp
protected override bool OnSetUp(string testName, IQuery query)
{
query.Access().CreateTable(table => table
.Named("APP.test_table")
.WithColumn("a", PrimitiveTypes.Integer())
.WithColumn("b", PrimitiveTypes.String()));
return true;
}