Repository navigation
Releases: xo/oracle
Release list
v0.3.0
A RAW reports its length, and a decimal of another package binds and scans.
go get github.com/xo/oracle@v0.3.0New
sql.ColumnType.Length()gives the declared length of aRAWin bytes,
soSYS_GUID()and aRAW(16)column give 16. A caller can tell a
RAW(16), which holds a GUID, from anotherRAW. AVARCHAR2,
NVARCHAR2,CHARandNCHARgive their length in characters. A
LONG,LONG RAW,CLOB,NCLOB,BLOBandBFILEgive
math.MaxInt64, asdatabase/sqlasks for a type with no limit.
NUMBER,DATEand the other types of fixed length give none. v0.2.0
gave a length for the string types only.- A decimal of another package binds as a
NUMBER, and scans from one with
every digit, when it has theDecomposeandComposemethods that
database/sqluses to pass a decimal as its parts. This holds for an
argument, an attribute of an object, and an OUT or IN OUT of PL/SQL. A
nil one binds as a NULL. v0.2.0 failed to bind such a decimal with "no
parameter coder registered", and failed to scan into one.
The API of v0.2.0 is unchanged.
v0.2.0
A UUID binds as a RAW(16), and a CLOB or a BLOB with an IS JSON check reads.
go get github.com/xo/oracle@v0.2.0New
- A
uuid.UUIDof the standard library binds as aRAW(16), which is how
Oracle stores a UUID. So do a*uuid.UUIDand asql.Null[uuid.UUID],
and a nil pointer or a NULL binds as a NULLRAW. A[]uuid.UUIDbinds
as a batch. An OUT into auuid.UUIDneeds no size. v0.1.x refused a
uuid.UUIDwith ORA-01484. - A
RAW(16)scans into a*uuid.UUID, and into*anyas a[]byte, as
everyRAWdoes. D37 indocs/PLAN.mdsays why.
Fixed
- A CLOB or a BLOB with an
IS JSONcheck failed to read in the default
inline LOB mode, withTTC error: received code 0. It now reads as any
other CLOB or BLOB. Withlob_fetch=streamit worked already.
The API of v0.1.1 is unchanged.
v0.1.1
A fix of the break that a context sends.
go get github.com/xo/oracle@v0.1.1When a context ends a call, the driver sends the break of Oracle Net and
marks it pending until the server answers. v0.1.0 marked the break after it
wrote it. When the server answered at once, as on a fast machine, the answer
came first and the flag stayed set. The next call on that connection then
waited 10 seconds for an answer that had come already, and failed with
driver.ErrBadConn. The driver now marks the break pending before it sends
it. TestBreakAnsweredAtOnce holds it.
Every user of v0.1.0 that ends calls with a context needs this release.
v0.1.0
The first release of github.com/xo/oracle, a pure Go Oracle Database
driver for database/sql. It is a fork of the v3 code of sijms/go-ora,
rewritten. A v0 version means that the API can still change (D36).
go get github.com/xo/oracle@v0.1.0The driver needs Go 1.27.1 or later. It is tested on Oracle 11g, 18c, 19c,
21c, 23ai and 26ai, on a server that requires native network encryption, and
on the Autonomous Database, 19c and 26ai.
What changed from go-ora
- The package is
oracle, and the DSN is a URL with lower case keys, such as
oracle://user:pass@host/service?sslmode=verify-full. The DSN of go-ora
does not parse. The README lists each key. - A
Connectorholds the state of one database: the registered types, the
session parameters and the fast login cookies. The package holds no state. - Each call takes a context. A context that ends breaks the call with an
Oracle Net break, and the connection stays usable. - A
NUMBERscans as anint64or an*apd.Decimal, by the type of its
column, so no digit is lost. ADATEand aTIMESTAMPare in UTC. - A nullable value is
sql.Null[T]. JSON usesencoding/json/v2. VECTORmaps to[]float32,[]float64,[]int8,[]byteand
SparseVector. Aboolbinds as aBOOLEAN.- New options of one statement:
WithTimeout,WithPrefetch,
WithLobFetch,WithBatchErrorsandWithRowCounts. - A LOB reads in pieces through
NewReader.DBMS_OUTPUTreads through
EnableOutputandReadOutput. RegisterTypetakes the records and collections of a PL/SQL package, and
the record of a row asTABLE%ROWTYPE.- An error from the server is a
*ServerError.errors.Ismatches it to
the sentinel errors, andAuthenticationRefusedsays when a new password
can help. - A build of a program that imports the driver is 12.5 MB, where it was
22.6 MB, because the charsets are a compressed blob.
The rewrite fixes many open issues of sijms/go-ora. docs/UPSTREAM.md
names each, with its test. The tests of python-oracledb that apply to this
driver are written again in integration.
Known limits
- No statement cache, DRCP, pipelining, scrollable cursors or Application
Continuity.docs/DRIVERS.mdcompares the drivers. docs/BACKLOG.mdlists the work that is known and not done.