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


  • namedParameters <Object> 一个可选对象,用于绑定命名参数。该对象的键用于配置映射。
  • ...anonymousParameters <null> | <number> | <bigint> | <string> | <Buffer> | <TypedArray> | <DataView> 零个或多个值,用于绑定到匿名参数。
  • 返回值:<Object> | <undefined> 执行准备语句后返回的第一行对应的对象。该对象的键和值分别对应行的列名和列值。如果数据库没有返回任何行,则此方法返回 undefined

此方法执行一个预处理语句并返回第一个结果作为对象。如果预处理语句没有返回任何结果,该方法返回 undefined。预处理语句 参数已绑定 使用 namedParametersanonymousParameters 中的值。

【This method executes a prepared statement and returns the first result as an object. If the prepared statement does not return any results, this method returns undefined. The prepared statement parameters are bound using the values in namedParameters and anonymousParameters.】