Documentation ¶
Index ¶
- Variables
- func Identifier(id string) (string, error)
- func IsPrivilege(p string) bool
- func IsValidParameterValue(value string, isTypeString bool) bool
- func MustBeIdentifier(id string) string
- func MustBeObjectName(id string) string
- func ObjectName(id string) (string, error)
- func QueryAlterUser(name, pass string) string
- func QueryCreateDir(dirName, path string) string
- func QueryCreatePDB(pdbName, adminUser, adminUserPass, dataFilesDir, defaultTablespace, ... string) string
- func QueryCreateUser(name, pass string) string
- func QueryGrantPrivileges(privileges, grantee string) string
- func QueryRevokePrivileges(privileges, grantee string) string
- func QuerySetSessionContainer(pdbName string) string
- func QuerySetSystemParameterNoPanic(name, value string, isTypeString bool) (string, error)
- func StringParam(s string) string
Constants ¶
This section is empty.
Variables ¶
var ( // ErrQuoteInIdentifier is an error returned when an identifier // contains a double-quote. ErrQuoteInIdentifier = errors.New("identifier contains double quotes") )
Functions ¶
func Identifier ¶
Identifier escapes an Oracle identifier. If id is not a valid identifier the ErrQuoteInIdentifier error is returned.
func IsPrivilege ¶
IsPrivilege returns true if parameter has the expected syntax of (comma separated) list of privileges.
func IsValidParameterValue ¶
IsValidParameterValue returns false if parameter value is not a valid one based on the parameter type. It still can return true in cases when parameter value won't be accepted by the database e.g. int value set for a boolean parameter or vice versa, but the cases relevant for constructing a syntactically correct query are supported.
func MustBeIdentifier ¶
MustBeIdentifier escapes an Oracle identifier. It panics if id is not a valid identifier.
func MustBeObjectName ¶
MustBeObjectName escapes an Oracle object name. It panics if id is not a valid identifier.
func ObjectName ¶
ObjectName escapes an Oracle object name. If id is not a valid identifier the ErrQuoteInIdentifier error is returned.
func QueryAlterUser ¶
QueryAlterUser constructs a sql statement for updating user password. It panics if any parameter is not a valid identifier.
func QueryCreateDir ¶
QueryCreateDir constructs a sql statement for creating a new Oracle directory. It panics if dirName is not a valid identifier.
func QueryCreatePDB ¶
func QueryCreatePDB(pdbName, adminUser, adminUserPass, dataFilesDir, defaultTablespace, defaultTablespaceDatafile, fileConvertFrom, fileConvertTo string) string
QueryCreatePDB constructs a sql statement for creating a new pluggable database. It panics if one of the following params is not a valid identifier * pdbName * adminUser * adminUserPass * defaultTablespace
func QueryCreateUser ¶
QueryCreateUser constructs a sql statement for creating a new database user. It panics if any parameter is not a valid identifier.
func QueryGrantPrivileges ¶
QueryGrantPrivileges constructs a sql statement for granting privileges. It panics if privileges is not a valid list of privileges (syntactically) or grantee is not a valid identifier.
func QueryRevokePrivileges ¶
QueryRevokePrivileges constructs a sql statement for revoking privileges. It panics if privileges is not a valid list of privileges (syntactically) or grantee is not a valid identifier.
func QuerySetSessionContainer ¶
QuerySetSessionContainer constructs a sql statement for changing session container to the given pdbName. It panics if pdbName is not a valid identifier.
func QuerySetSystemParameterNoPanic ¶
QuerySetSystemParameter constructs a sql statement for setting a database parameter. It returns an error if IsValidParameterValue(value, isTypeString) return false.
Types ¶
This section is empty.