예제 #1
0
 def __init__(self, server: 's.Server', parent: NodeObject, name: str):
     NodeObject.__init__(self, server, parent, name)
     ScriptableCreate.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableDelete.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableUpdate.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableSelect.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     self._schema: str = None
     self._scid: int = None
     # Declare child items
     self._check_constraints: NodeCollection[
         CheckConstraint] = self._register_child_collection(CheckConstraint)
     self._columns: NodeCollection[
         Column] = self._register_child_collection(Column)
     self._exclusion_constraints: NodeCollection[
         ExclusionConstraint] = self._register_child_collection(
             ExclusionConstraint)
     self._foreign_key_constraints: NodeCollection[
         ForeignKeyConstraint] = self._register_child_collection(
             ForeignKeyConstraint)
     self._index_constraints: NodeCollection[
         IndexConstraint] = self._register_child_collection(IndexConstraint)
     self._indexes: NodeCollection[Index] = self._register_child_collection(
         Index)
     self._rules: NodeCollection[Rule] = self._register_child_collection(
         Rule)
     self._triggers: NodeCollection[
         Trigger] = self._register_child_collection(Trigger)
예제 #2
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str):
        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server), self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server), self._macro_root(), server.version)

        self._schema: str = None
        self._scid: int = None
예제 #3
0
 def __init__(self, server: 's.Server', name: str):
     """
     Initializes a new instance of a database
     """
     NodeObject.__init__(self, server, None, name)
     ScriptableCreate.__init__(self, self._template_root(self.server), self._macro_root(), self.server.version)
     ScriptableDelete.__init__(self, self._template_root(self.server), self._macro_root(), self.server.version)
예제 #4
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str,
                 datatype: str):
        """
        Initializes a new instance of a Column
        :param server: Connection to the server/database that this object will belong to
        :param parent: Parent object of the column, should be a Table/View
        :param name: Name of the column
        :param datatype: Type of the column
        """
        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        self._datatype: str = datatype

        self._has_default_value: Optional[bool] = None
        self._not_null: Optional[bool] = None

        self._column_ordinal: int = None
        self._is_key: bool = None
        self._is_readonly: bool = None
        self._is_unique: bool = None
        self._type_oid: int = None
        self._default_value: Optional[str] = None
        self._is_auto_increment = None
예제 #5
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str):
        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server), self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server), self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server), self._macro_root(), server.version)

        # Declare the optional parameters
        self._can_create: Optional[bool] = None
        self._has_usage: Optional[bool] = None
예제 #6
0
    def __init__(self, server: 's.Server', name: str):
        """
        Initializes internal state of a Role object
        """
        NodeObject.__init__(self, server, None, name)
        ScriptableCreate.__init__(self, self._template_root(server), self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server), self._macro_root(), server.version)

        # Declare basic properties
        self._can_login: Optional[bool] = None
        self._is_super: Optional[bool] = None
예제 #7
0
    def __init__(self, server: 's.Server', name: str, dbname: str):
        NodeObject.__init__(self, server, None, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableSelect.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        self._dbname = dbname
        self._server = server
        self._server_version = server.version
예제 #8
0
 def __init__(self, server: 's.Server', parent: NodeObject, name: str):
     """
     Initializes a new instance of an rule
     :param server: Server that owns the rule
     :param parent: Parent object of the rule. Should be Table/View
     :param name: Name of the rule
     """
     NodeObject.__init__(self, server, parent, name)
     ScriptableCreate.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableDelete.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableUpdate.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
예제 #9
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str):
        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        # Declare the basic properties
        self._description: Optional[str] = None
        self._language_name: Optional[str] = None
        self._owner: Optional[str] = None
        self._schema: str = None
        self._scid: int = None
예제 #10
0
 def __init__(self, server: 's.Server', parent: NodeObject, name: str):
     NodeObject.__init__(self, server, parent, name)
     ScriptableCreate.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableDelete.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableUpdate.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     ScriptableSelect.__init__(self, self._template_root(server),
                               self._macro_root(), server.version)
     self._schema: str = None
     self._scid: int = None
     self._database = self.get_database_node()
     # Declare child items
     self._columns: NodeCollection[
         Column] = self._register_child_collection(Column)
예제 #11
0
 def __init__(self, server: 's.Server', parent: NodeObject, name: str):
     """
     Initializes internal state of a DataType object
     :param server: Server that owns the role
     :param name: Name of the role
     """
     NodeObject.__init__(self, server, parent, name)
     ScriptableCreate.__init__(self, self._template_root(self.server),
                               self._macro_root(), self.server.version)
     ScriptableDelete.__init__(self, self._template_root(self.server),
                               self._macro_root(), self.server.version)
     ScriptableUpdate.__init__(self, self._template_root(self.server),
                               self._macro_root(), self.server.version)
     self._schema: str = None
     self._scid: int = None
     self._additional_properties: NodeLazyPropertyCollection = self._register_property_collection(
         self._additional_property_generator)
예제 #12
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str):
        """
        Initializes a new instance of a trigger
        :param server: Connection the trigger belongs to
        :param parent: Parent object of the trigger. Should be Table/View
        :param name: Name of the trigger
        """
        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        # Declare Trigger-specific basic properties
        self._is_enabled: Optional[bool] = None
예제 #13
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str):
        """
        Initializes a new instance of a constraint
        :param server: Connection the constraint belongs to
        :param parent: Parent object of the constraint. Should be Table
        :param name: Name of the constraint
        """

        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        # Declare constraint-specific basic properties
        self._convalidated = None
예제 #14
0
    def __init__(self, server: 's.Server', parent: NodeObject, name: str):
        """
        Initializes a new instance of an Index
        :param server: Server that owns the index
        :param parent: Parent object of the index. Should be Table/View
        :param name: Name of the index
        """
        NodeObject.__init__(self, server, parent, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableUpdate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        # Object Properties
        self._is_clustered: Optional[bool] = None
        self._is_primary: Optional[bool] = None
        self._is_unique: Optional[bool] = None
        self._is_valid: Optional[bool] = None
        self._is_concurrent: Optional[bool] = None
예제 #15
0
    def __init__(self, server: 's.Server', name: str):
        """
        Initializes a new instance of a database
        """
        NodeObject.__init__(self, server, None, name)
        ScriptableCreate.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)
        ScriptableDelete.__init__(self, self._template_root(server),
                                  self._macro_root(), server.version)

        # Declare the optional parameters
        self._tablespace: Optional[str] = None
        self._allow_conn: Optional[bool] = None
        self._is_template: Optional[bool] = None
        self._can_connect: Optional[bool] = None
        self._can_create: Optional[bool] = None
        self._owner_oid: Optional[int] = None
        self._connection: ServerConnection = None

        if server.maintenance_db_name == name:
            self._connection = server.connection

        # Declare the child items
        self._schemas = self._register_child_collection(Schema)
        self._tables: NodeCollection = self._register_child_collection(Table)
        self._views: NodeCollection = self._register_child_collection(View)
        self._collations: NodeCollection = self._register_child_collection(
            Collation)
        self._datatypes: NodeCollection = self._register_child_collection(
            DataType)
        self._functions: NodeCollection = self._register_child_collection(
            Function)
        self._sequences: NodeCollection = self._register_child_collection(
            Sequence)
        self._trigger_functions: NodeCollection = self._register_child_collection(
            TriggerFunction)
        self._extensions: NodeCollection = self._register_child_collection(
            Extension)
        self._materialized_views: NodeCollection = self._register_child_collection(
            MaterializedView)
예제 #16
0
 def __init__(self, server: 's.Server', name: str):
     """
     Initializes a new instance of a database
     """
     NodeObject.__init__(self, server, None, name)