Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Universal characterSet = unicode.UTF8 EuroSymbolSupport characterSet = charmap.Windows1252 QueryTemplates = map[string]string{ `GetSingle`: `SELECT * ` + `FROM "{{.TableName}}" "_{{.TableName}}"` + `{{range .Relations}}` + ` LEFT JOIN "{{.Relationship.WithTable}}"` + ` ON "{{.Relationship.WithTable}}"."{{.Relationship.ForeignTableUniqueIDColumn}}"` + ` = "_{{$.TableName}}"."{{.Relationship.LocalTableUniqueIDColumn}}"` + `{{end}}` + ` WHERE "_{{$.TableName}}"."{{.UniqueIDColumn}}" = :1`, `GetSingleAsOption`: `SELECT "{{.UniqueIDColumn}}", "{{.ColumnAsOptionName}}" ` + `FROM "{{.TableName}}" ` + `WHERE "{{.UniqueIDColumn}}" = :1`, `GetCollection`: `SELECT * ` + `FROM "{{.TableName}}"`, `GetCollectionFilterable`: `SELECT * ` + `FROM "{{.TableName}}" ` + `WHERE "{{.FilterOnColumn}}" {{$.Operator}} {{(format -1 .FilterOnColumn)}}`, `GetCollectionAsOptions`: `SELECT "{{.UniqueIDColumn}}", "{{.ColumnAsOptionName}}" ` + `FROM "{{.TableName}}"`, `GetCollectionAsOptionsFilterable`: `SELECT "{{.UniqueIDColumn}}", "{{.ColumnAsOptionName}}" ` + `FROM "{{.TableName}}" ` + `WHERE UPPER("{{.ColumnAsOptionName}}") LIKE '%'||UPPER(:1)||'%'`, `GetCollectionAsOptionsWithParams`: `SELECT "{{.UniqueIDColumn}}", "{{.ColumnAsOptionName}}" ` + `FROM "{{.TableName}}" ` + `WHERE UPPER("{{.ColumnAsOptionName}}") LIKE '%'||UPPER(:1)||'%' ` + `{{range $index, $element := .ColumnNames}}` + `AND "{{$element}}" = {{(format $index $element)}} ` + `{{end}}`, `UpdateSingle`: `UPDATE "{{.TableName}}" ` + `{{with $firstColumn := .ColumnNames | head}}` + `SET "{{$firstColumn}}" = {{(format -1 $firstColumn)}}` + `{{end}}` + `{{range $index, $element := .ColumnNames | tail}},` + ` "{{$element}}" = {{(format $index $element)}}` + `{{end}} ` + `WHERE "{{.UniqueIDColumn}}"= :{{(lenPlus1 .ColumnNames)}}`, `CreateSingle`: `DECLARE "l_{{.UniqueIDColumn}}" nvarchar2(256); ` + `BEGIN ` + `INSERT INTO "{{.TableName}}"` + `("{{.ColumnNames | head}}"` + `{{range .ColumnNames | tail}},` + ` "{{.}}"` + `{{end}}) ` + `{{with $firstColumn := .ColumnNames | head}}` + `VALUES({{(format -1 $firstColumn)}}` + `{{end}}` + `{{range $index, $element := .ColumnNames | tail}},` + ` {{format $index $element}}` + `{{end}}) RETURNING "{{.UniqueIDColumn}}" INTO "l_{{.UniqueIDColumn}}"; ` + `DBMS_OUTPUT.PUT_LINE("l_{{.UniqueIDColumn}}"); ` + "END;", `DeleteSingle`: `DELETE FROM "{{.TableName}}" WHERE "{{.UniqueIDColumn}}" = :1`, `GetTableSchema`: `SELECT * ` + `FROM "{{.TableName}}" ` + `WHERE ROWNUM <= 1`, `GetTableWithRelationshipsSchema`: `SELECT * FROM "{{.TableName}}" "_{{.TableName}}"` + `{{range .Relations}}` + ` LEFT JOIN "{{.Relationship.WithTable}}"` + ` ON "{{.Relationship.WithTable}}"."{{.Relationship.ForeignTableUniqueIDColumn}}"` + ` = "_{{$.TableName}}"."{{.Relationship.LocalTableUniqueIDColumn}}"{{end}} WHERE ROWNUM <= 1`, } )
Functions ¶
Types ¶
type Oracle ¶
type Oracle struct { *sqlBackend.SqlBackend // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.