Exemplo n.º 1
0
 def getColumnIsUnique(self, col):
     """
     Returns 1 if the specified column is unique and
     0 otherwise.
     """
     return CSQLRelay.getColumnIsUnique(self.cursor, col)
Exemplo n.º 2
0
 def errorMessage(self):
     """
     If the operation failed, the error message will be returned
     from this method.  Otherwise, it returns None.
     """
     return CSQLRelay.connectionErrorMessage(self.connection)
Exemplo n.º 3
0
 def getDebug(self):
     """
     Returns 1 if debugging is turned on and 0 if debugging is turned off.
     """
     return CSQLRelay.getDebug(self.connection)
Exemplo n.º 4
0
 def autoCommitOn(self):
     """
     Instructs the database to perform a commit
     after every successful query.
     """
     return CSQLRelay.autoCommitOn(self.connection)
Exemplo n.º 5
0
 def commit(self):
     """
     Issues a commit, returns true if the commit
     succeeded, false if it failed.
     """
     return CSQLRelay.commit(self.connection)
Exemplo n.º 6
0
 def bindFormat(self):
     """
     Returns a string representing the format
     of the bind variables used in the db.
     """
     return CSQLRelay.bindFormat(self.connection)
Exemplo n.º 7
0
 def getCurrentDatabase(self):
     """
     Returns the database/schema that is currently in use.
     """
     return CSQLRelay.getCurrentDatabase(self.connection)
Exemplo n.º 8
0
 def getLongest(self, col):
     """
     Returns the length of the specified column.  col may
     be a name or number.
     """
     return CSQLRelay.getLongest(self.cursor, col)
Exemplo n.º 9
0
    def enableTls(self, version, cert, password, ciphers, validate, ca, depth):
        """
        Enables TLS/SSL encryption, and optionally authentication.

        "version" specifies the TLS/SSL protocol version that the
        client will attempt to use.  Valid values include SSL2,
        SSL3, TLS1, TLS1.1, TLS1.2 or any more recent version of
        TLS, as supported by and enabled in the underlying TLS/SSL
        library.  If left blank or empty then the highest supported
        version will be negotiated.
        
        "cert" is the file name of the certificate chain file to
        send to the SQL Relay server.  This is only necessary if
        the SQL Relay server is configured to authenticate and
        authorize clients by certificate.
        
        If "cert" contains a password-protected private key, then
        "password" may be supplied to access it.  If the private
        key is not password-protected, then this argument is
        ignored, and may be left empty or NULL.
        
        "ciphers" is a list of ciphers to allow.  Ciphers may be
        separated by spaces, commas, or colons.  If "ciphers" is
        empty or NULL then a default set is used.  Only set this if
        you know that you have a good reason to.
        
        For a list of valid ciphers on Linux/Unix platforms, see:
            man ciphers
        
        For a list of valid ciphers on Windows platforms, see:
            https://msdn.microsoft.com/en-us/library/windows/desktop/aa375549%28v=vs.85%29.aspx
        On Windows platforms, the ciphers (alg_id's) should omit
        CALG_ and may be given with underscores or dashes.
        For example: 3DES_112
        
        "validate" indicates whether to validate the SQL Relay's
        server certificate, and may be set to one of the following:
            "no" - Don't validate the server's certificate.
            "ca" - Validate that the server's certificate was
                   signed by a trusted certificate authority.
            "ca+host" - Perform "ca" validation and also validate
                   that one of the subject altenate names (or the
                   common name if no SANs are present) in the
                   certificate matches the host parameter.
                   (Falls back to "ca" validation when a unix
                   socket is used.)
            "ca+domain" - Perform "ca" validation and also validate
                   that the domain name of one of the subject
                   alternate names (or the common name if no SANs
                   are present) in the certificate matches the
                   domain name of the host parameter.  (Falls back
                   to "ca" validation when a unix socket is used.)
        
        "ca" is the location of a certificate authority file to
        use, in addition to the system's root certificates, when
        validating the SQL Relay server's certificate.  This is
        useful if the SQL Relay server's certificate is self-signed.
        
        On Windows, "ca" must be a file name.
        
        On non-Windows systems, "ca" can be either a file or
        directory name.  If it is a directory name, then all
        certificate authority files found in that directory will be
        used.  If it a file name, then only that file will be used.
        
        
        Note that the supported "cert" and "ca" file formats may
        vary between platforms.  A variety of file formats are
        generally supported on Linux/Unix platfoms (.pem, .pfx,
        etc.) but only the .pfx format is currently supported on
        Windows. */
        """
        return CSQLRelay.enableTls(self.connection, version, cert, password,
                                   ciphers, validate, ca, depth)
Exemplo n.º 10
0
 def getColumnIsBinary(self, col):
     """
     Returns 1 if the specified column contains binary data
     and 0 otherwise.
     """
     return CSQLRelay.getColumnIsBinary(self.cursor, col)
Exemplo n.º 11
0
 def getColumnIsAutoIncrement(self, col):
     """
     Returns 1 if the specified column auto-increments and
     0 otherwise.
     """
     return CSQLRelay.getColumnIsAutoIncrement(self.cursor, col)
Exemplo n.º 12
0
 def getColumnIsZeroFilled(self, col):
     """
     Returns 1 if the specified column was created with the
     zero-fill flag and 0 otherwise.
     """
     return CSQLRelay.getColumnIsZeroFilled(self.cursor, col)
Exemplo n.º 13
0
 def getColumnIsUnsigned(self, col):
     """
     Returns 1 if the specified column is an unsigned number
     and 0 otherwise.
     """
     return CSQLRelay.getColumnIsUnsigned(self.cursor, col)
Exemplo n.º 14
0
 def getColumnIsPartOfKey(self, col):
     """
     Returns 1 if the specified column is part of a composite
     key and 0 otherwise.
     """
     return CSQLRelay.getColumnIsPartOfKey(self.cursor, col)
Exemplo n.º 15
0
 def serverVersion(self):
     """
     Returns the version of the SQL Relay server version
     """
     return CSQLRelay.serverVersion(self.connection)
Exemplo n.º 16
0
 def disableEncryption(self):
     """
     Disables encryption.
     """
     return CSQLRelay.disableEncryption(self.connection)
Exemplo n.º 17
0
 def clientVersion(self):
     """
     Returns the version of the SQL Relay client version
     """
     return CSQLRelay.clientVersion(self.connection)
Exemplo n.º 18
0
 def endSession(self):
     """
     Ends the current session.
     """
     return CSQLRelay.endSession(self.connection)
Exemplo n.º 19
0
 def selectDatabase(self, database):
     """
     Sets the current database/schema to "database"
     """
     return CSQLRelay.selectDatabase(self.connection, database)
Exemplo n.º 20
0
 def ping(self):
     """
     Returns 1 if the database is up and 0
     if it's down.
     """
     return CSQLRelay.ping(self.connection)
Exemplo n.º 21
0
 def getLastInsertId(self):
     """
     Returns the value of the autoincrement column for the last insert
     """
     return CSQLRelay.getLastInsertId(self.connection)
Exemplo n.º 22
0
 def identify(self):
     """
     Returns the type of database: 
       oracle, postgresql, mysql, etc.
     """
     return CSQLRelay.identify(self.connection)
Exemplo n.º 23
0
 def autoCommitOff(self):
     """
     Instructs the database to wait for the 
     client to tell it when to commit.
     """
     return CSQLRelay.autoCommitOff(self.connection)
Exemplo n.º 24
0
 def dbVersion(self):
     """
     Returns the version of the database
     """
     return CSQLRelay.dbVersion(self.connection)
Exemplo n.º 25
0
 def rollback(self):
     """
     Issues a rollback, returns true if the rollback
     succeeded, false if it failed.
     """
     return CSQLRelay.rollback(self.connection)
Exemplo n.º 26
0
 def dbHostName(self):
     """
     Returns the host name of the database
     """
     return CSQLRelay.dbHostName(self.connection)
Exemplo n.º 27
0
 def debugOff(self):
     """
     Turn verbose debugging off.
     """
     return CSQLRelay.debugOff(self.connection)
Exemplo n.º 28
0
 def dbIpAddress(self):
     """
     Returns the ip address of the database
     """
     return CSQLRelay.dbIpAddress(self.connection)
Exemplo n.º 29
0
 def getClientInfo(self):
     """
     Returns the string that was set by setClientInfo().
     """
     return CSQLRelay.getClientInfo(self.connection)
Exemplo n.º 30
0
 def getColumnIsPrimaryKey(self, col):
     """
     Returns 1 if the specified column is a primary key and
     0 otherwise.
     """
     return CSQLRelay.getColumnIsPrimaryKey(self.cursor, col)