more docs

This commit is contained in:
Jim Lambert 2020-02-18 07:16:24 -05:00
parent dea5ee724a
commit 9ecaf496db
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,8 @@
package gorm package gorm
// OraDialect interface allows for each Ora driver to implement custom behaviours // OraDialect interface allows for each Ora driver to implement custom behaviours. Defining
// a required oracle dialect interface also allows us to assert the interface whenever we
// have oracle specific behaviours in the rest of gorm.
type OraDialect interface { type OraDialect interface {
// CreateWithReturningInto is called by gorm.createCallback(*Scope) and will create new entity while populating the identity ID into the primary key // CreateWithReturningInto is called by gorm.createCallback(*Scope) and will create new entity while populating the identity ID into the primary key
// different drivers will have different ways of handling this behaviour for Ora // different drivers will have different ways of handling this behaviour for Ora

View File

@ -39,7 +39,9 @@ This design decision has the following side affects:
parameter to return the value in the oci8 driver. Since Oracle parameters parameter to return the value in the oci8 driver. Since Oracle parameters
are positional, you need to know how many other bind variables there are before are positional, you need to know how many other bind variables there are before
adding the returning clause. We've implemented the adding the returning clause. We've implemented the
OraDialect.CreateWithReturningInto(*Scope) to handle this. OraDialect.CreateWithReturningInto(*Scope) to handle this. Defining this oracle
specific interface also allows us to assert for the interface, whenever we have
oracle specific behaviours in the rest of gorm.
3. Oracle doesn't let you specify "AS <tablename> " when selecting a count 3. Oracle doesn't let you specify "AS <tablename> " when selecting a count
from a dynamic table, so you just omit it. (see Scope.count() ) from a dynamic table, so you just omit it. (see Scope.count() )