statement.all([namedParameters][, ...anonymousParameters])


  • namedParameters <Object> 用于绑定命名参数的可选对象。此对象的键用于配置映射。

    ¥namedParameters <Object> An optional object used to bind named parameters. The keys of this object are used to configure the mapping.

  • ...anonymousParameters <null> | <number> | <bigint> | <string> | <Buffer> | <TypedArray> | <DataView> 零个或多个值绑定到匿名参数。

    ¥...anonymousParameters <null> | <number> | <bigint> | <string> | <Buffer> | <TypedArray> | <DataView> Zero or more values to bind to anonymous parameters.

  • 返回:<Array> 对象数组。每个对象对应于执行准备好的语句返回的一行。每个对象的键和值对应于行的列名和值。

    ¥Returns: <Array> An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of the row.

此方法执行准备好的语句并将所有结果作为对象数组返回。如果准备好的语句没有返回任何结果,则此方法返回一个空数组。使用 namedParametersanonymousParameters 中的值的准备好的语句 参数已绑定

¥This method executes a prepared statement and returns all results as an array of objects. If the prepared statement does not return any results, this method returns an empty array. The prepared statement parameters are bound using the values in namedParameters and anonymousParameters.