跳到主要内容

shouldUsePreparedStatementPath()

function shouldUsePreparedStatementPath(sql): boolean;

Defined in: packages/rxdb-adapter-sqlite-core/src/execute-sql.utils.ts:26

判断是否应当走 prepared statement 路径(而非批量 exec)。

满足全部条件才返回 true:

  • 是单条语句(normalize 后不含 ;
  • 是 SELECT/EXPLAIN,或 DML 含 RETURNING 子句(需要返回结果集)

多语句 / 纯 DML 走 exec 路径,避免 prepare 的额外开销。

Parameters

ParameterType
sqlstring

Returns

boolean