Documentation Home
MySQL 9.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 39.9Mb
PDF (A4) - 40.0Mb
Man Pages (TGZ) - 258.2Kb
Man Pages (Zip) - 365.4Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


27.3.6.1 Session Object

The Session object is always available as the session property of the global object. Session has the methods listed here:

  • getOption(String name): Gets the value of statement option name. Returns a string or a true-false value depending on the option type.

  • prepare(String sql, {passResultToClient: Bool, charsetName: String}): Enables the execution of a prepared statements; takes an SQL statement and returns a PreparedStatement object.

    Calling this method is equivalent to executing a PREPARE statement in the mysql client.

  • quoteName(String name): Returns name, after escaping it.

  • runSql(String query[[, Array statementParameters], Options options]): Executes a query, with any options specified, and using an optional list of statement parameters; it returns an SqlResult.

  • setOptions(Object options): Sets statement option defaults. Options not specified assume their default values.

  • sql(String sql, {passResultToClient: Bool, charsetName: String}): Executes a simple SQL statement. Can also be used to provide attributes overriding the passResultlToClient and charsetName values set in the session. Returns an SqlExecute object.