From 9ecaf496db9c9e09c320a8aff341f88c4c1c76c1 Mon Sep 17 00:00:00 2001 From: Jim Lambert Date: Tue, 18 Feb 2020 07:16:24 -0500 Subject: [PATCH] more docs --- dialect_ora.go | 4 +++- dialect_oracommon.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dialect_ora.go b/dialect_ora.go index 3aa1e5cd..60070304 100644 --- a/dialect_ora.go +++ b/dialect_ora.go @@ -1,6 +1,8 @@ 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 { // 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 diff --git a/dialect_oracommon.go b/dialect_oracommon.go index 095562cb..c86148e1 100644 --- a/dialect_oracommon.go +++ b/dialect_oracommon.go @@ -39,7 +39,9 @@ This design decision has the following side affects: 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 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 " when selecting a count from a dynamic table, so you just omit it. (see Scope.count() )