コード例 #1
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getColumnIsUnique(self, col):
     """
     Returns 1 if the specified column is unique and
     0 otherwise.
     """
     return CSQLRelay.getColumnIsUnique(self.cursor, col)
コード例 #2
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 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)
コード例 #3
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getDebug(self):
     """
     Returns 1 if debugging is turned on and 0 if debugging is turned off.
     """
     return CSQLRelay.getDebug(self.connection)
コード例 #4
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def autoCommitOn(self):
     """
     Instructs the database to perform a commit
     after every successful query.
     """
     return CSQLRelay.autoCommitOn(self.connection)
コード例 #5
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def commit(self):
     """
     Issues a commit, returns true if the commit
     succeeded, false if it failed.
     """
     return CSQLRelay.commit(self.connection)
コード例 #6
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def bindFormat(self):
     """
     Returns a string representing the format
     of the bind variables used in the db.
     """
     return CSQLRelay.bindFormat(self.connection)
コード例 #7
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getCurrentDatabase(self):
     """
     Returns the database/schema that is currently in use.
     """
     return CSQLRelay.getCurrentDatabase(self.connection)
コード例 #8
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getLongest(self, col):
     """
     Returns the length of the specified column.  col may
     be a name or number.
     """
     return CSQLRelay.getLongest(self.cursor, col)
コード例 #9
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
    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)
コード例 #10
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getColumnIsBinary(self, col):
     """
     Returns 1 if the specified column contains binary data
     and 0 otherwise.
     """
     return CSQLRelay.getColumnIsBinary(self.cursor, col)
コード例 #11
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getColumnIsAutoIncrement(self, col):
     """
     Returns 1 if the specified column auto-increments and
     0 otherwise.
     """
     return CSQLRelay.getColumnIsAutoIncrement(self.cursor, col)
コード例 #12
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 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)
コード例 #13
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getColumnIsUnsigned(self, col):
     """
     Returns 1 if the specified column is an unsigned number
     and 0 otherwise.
     """
     return CSQLRelay.getColumnIsUnsigned(self.cursor, col)
コード例 #14
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 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)
コード例 #15
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def serverVersion(self):
     """
     Returns the version of the SQL Relay server version
     """
     return CSQLRelay.serverVersion(self.connection)
コード例 #16
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def disableEncryption(self):
     """
     Disables encryption.
     """
     return CSQLRelay.disableEncryption(self.connection)
コード例 #17
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def clientVersion(self):
     """
     Returns the version of the SQL Relay client version
     """
     return CSQLRelay.clientVersion(self.connection)
コード例 #18
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def endSession(self):
     """
     Ends the current session.
     """
     return CSQLRelay.endSession(self.connection)
コード例 #19
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def selectDatabase(self, database):
     """
     Sets the current database/schema to "database"
     """
     return CSQLRelay.selectDatabase(self.connection, database)
コード例 #20
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def ping(self):
     """
     Returns 1 if the database is up and 0
     if it's down.
     """
     return CSQLRelay.ping(self.connection)
コード例 #21
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getLastInsertId(self):
     """
     Returns the value of the autoincrement column for the last insert
     """
     return CSQLRelay.getLastInsertId(self.connection)
コード例 #22
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def identify(self):
     """
     Returns the type of database: 
       oracle, postgresql, mysql, etc.
     """
     return CSQLRelay.identify(self.connection)
コード例 #23
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def autoCommitOff(self):
     """
     Instructs the database to wait for the 
     client to tell it when to commit.
     """
     return CSQLRelay.autoCommitOff(self.connection)
コード例 #24
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def dbVersion(self):
     """
     Returns the version of the database
     """
     return CSQLRelay.dbVersion(self.connection)
コード例 #25
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def rollback(self):
     """
     Issues a rollback, returns true if the rollback
     succeeded, false if it failed.
     """
     return CSQLRelay.rollback(self.connection)
コード例 #26
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def dbHostName(self):
     """
     Returns the host name of the database
     """
     return CSQLRelay.dbHostName(self.connection)
コード例 #27
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def debugOff(self):
     """
     Turn verbose debugging off.
     """
     return CSQLRelay.debugOff(self.connection)
コード例 #28
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def dbIpAddress(self):
     """
     Returns the ip address of the database
     """
     return CSQLRelay.dbIpAddress(self.connection)
コード例 #29
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getClientInfo(self):
     """
     Returns the string that was set by setClientInfo().
     """
     return CSQLRelay.getClientInfo(self.connection)
コード例 #30
0
ファイル: PySQLRClient.py プロジェクト: joegana/sqlrelay
 def getColumnIsPrimaryKey(self, col):
     """
     Returns 1 if the specified column is a primary key and
     0 otherwise.
     """
     return CSQLRelay.getColumnIsPrimaryKey(self.cursor, col)