13 if (context.CursorExists(objectName.
Name))
15 if (context.VariableExists(objectName.
Name))
20 return context.Session().ObjectExists(objectName);
27 context.CursorExists(objectName.
Name))
31 context.VariableExists(objectName.
Name))
36 return context.Session().ObjectExists(objectType, objectName);
40 return GetObject(context, objType, objName,
AccessType.ReadWrite);
49 var obj = context.FindCursor(objName.
Name);
53 var obj = context.FindVariable(objName.
Name);
59 if (!context.UserCanAccessObject(objType, objName))
60 throw new InvalidOperationException();
62 return context.Session().GetObject(objType, objName, accessType);
68 throw new InvalidOperationException();
70 context.Session().CreateObject(objectInfo);
75 context.DropVariable(objectName.
Name)) {
79 context.DropCursor(objectName.
Name)) {
83 if (!context.UserCanDropObject(objectType, objectName))
86 context.Session().DropObject(objectType, objectName);
91 if (objectInfo == null)
92 throw new ArgumentNullException(
"objectInfo");
97 context.Session().AlterObject(objectInfo);
101 if (context.VariableExists(name) ||
102 context.CursorExists(name))
105 return context.Session().ResolveObjectName(name);
110 context.VariableExists(objectName.
Name))
113 context.CursorExists(objectName.
Name))
116 return context.Session().ResolveObjectName(objectType, objectName);
120 return context.Session().FindObject(objectName);
static bool DropObject(this IQueryContext context, DbObjectType objectType, ObjectName objectName)
static ObjectName ResolveObjectName(this IQueryContext context, DbObjectType objectType, ObjectName objectName)
static IDbObject GetObject(this IQueryContext context, DbObjectType objType, ObjectName objName)
static bool ObjectExists(this IQueryContext context, DbObjectType objectType, ObjectName objectName)
Represents a database object, such as a table, a trigger, a type or a column.
static void CreateObject(this IQueryContext context, IObjectInfo objectInfo)
Provides a context for executing queries, accessing the system resources and evaluation context...
Describes the name of an object within a database.
static bool ObjectExists(this IQueryContext context, ObjectName objectName)
static IDbObject GetObject(this IQueryContext context, DbObjectType objType, ObjectName objName, AccessType accessType)
static void AlterObject(this IQueryContext context, IObjectInfo objectInfo)
string Name
Gets the name of the object being referenced.
static ObjectName ResolveObjectName(this IQueryContext context, string name)
DbObjectType
The kind of objects that can be handled by a database system and its managers
static IDbObject FindObject(this IQueryContext context, ObjectName objectName)