Oracle
安装
npm install oracledb默认情况下,oracledb 使用"thin 模式"连接。要启用"thick 模式",你需要按照他们用户指南中的安装说明操作。
数据源选项
通用数据源选项请参阅数据源选项。
sid- 系统标识符(SID)用于标识一个特定的数据库实例。例如 "sales"。serviceName- 服务名是数据库服务的标识符。例如sales.us.example.com。
列类型
char、nchar、nvarchar2、varchar2、long、raw、long raw、number、numeric、float、dec、decimal、integer、int、smallint、real、double precision、date、timestamp、timestamp with time zone、timestamp with local time zone、interval year to month、interval day to second、bfile、blob、clob、nclob、rowid、urowid
Oracle 专属行为
自定义 UPDATE RETURNING 子句
当 update、soft-delete 或 restore 查询使用了带输出绑定的 SQL 字符串,例如 .returning('"version" INTO :version') 时,UpdateResult.raw 中包含驱动的输出绑定值。例如,如果有一行返回 version 2,raw 结果就是 [[2]]。TypeORM 无法把这些绑定值映射到实体列,因此传给 whereEntity() 的实体会改为通过一条单独的按主键 SELECT 来刷新(除非设置了 updateEntity(false))。
Installation
npm install oracledbBy default, the oracledb uses the "thin mode" to connect. To enable the "thick mode", you need to follow the installation instructions from their user guide.
Data Source Options
See Data Source Options for the common data source options.
sid- The System Identifier (SID) identifies a specific database instance. For example, "sales".serviceName- The Service Name is an identifier of a database service. For example,sales.us.example.com.
Column Types
char, nchar, nvarchar2, varchar2, long, raw, long raw, number, numeric, float, dec, decimal, integer, int, smallint, real, double precision, date, timestamp, timestamp with time zone, timestamp with local time zone, interval year to month, interval day to second, bfile, blob, clob, nclob, rowid, urowid
Oracle-specific behavior
Custom UPDATE RETURNING clauses
When an update, soft-delete or restore query uses a SQL string such as .returning('"version" INTO :version') with an output bind, UpdateResult.raw contains the driver's output binds. For example, if one row returns version 2, the raw result is [[2]]. TypeORM cannot map these binds to entity columns, so entities supplied to whereEntity() are refreshed with a separate SELECT by primary key instead (unless updateEntity(false) is set).