DBD-SQLite

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

  $action_code
      is an integer equal to either "DBD::SQLite::INSERT",
      "DBD::SQLite::DELETE" or "DBD::SQLite::UPDATE" (see "Action
      Codes");

  $database
      is the name of the database containing the affected row;

  $table
      is the name of the table containing the affected row;

  $rowid
      is the unique 64-bit signed integer key of the affected row
      within that table.

 $dbh->sqlite_set_authorizer( $code_ref )
  This method registers an authorizer callback to be invoked
  whenever SQL statements are being compiled by the "prepare" in DBI
  method. The authorizer callback should return "DBD::SQLite::OK" to
  allow the action, "DBD::SQLite::IGNORE" to disallow the specific
  action but allow the SQL statement to continue to be compiled, or
  "DBD::SQLite::DENY" to cause the entire SQL statement to be
  rejected with an error. If the authorizer callback returns any
  other value, then "prepare" call that triggered the authorizer
  will fail with an error message.

  An authorizer is used when preparing SQL statements from an
  untrusted source, to ensure that the SQL statements do not try to
  access data they are not allowed to see, or that they do not try
  to execute malicious statements that damage the database. For
  example, an application may allow a user to enter arbitrary SQL
  queries for evaluation by a database. But the application does not
  want the user to be able to make arbitrary changes to the
  database. An authorizer could then be put in place while the
  user-entered SQL is being prepared that disallows everything
  except SELECT statements.

  The callback will be called as

    $code_ref->($action_code, $string1, $string2, $database, $trigger_or_view)

  where

  $action_code
      is an integer that specifies what action is being authorized
      (see "Action Codes").

  $string1, $string2
      are strings that depend on the action code (see "Action
      Codes").

  $database
      is the name of the database ("main", "temp", etc.) if
      applicable.

  $trigger_or_view
      is the name of the inner-most trigger or view that is
      responsible for the access attempt, or "undef" if this access
      attempt is directly from top-level SQL code.

 $dbh->sqlite_backup_from_file( $filename )
  This method accesses the SQLite Online Backup API, and will take a
  backup of the named database file, copying it to, and overwriting,
  your current database connection. This can be particularly handy
  if your current connection is to the special :memory: database,
  and you wish to populate it from an existing DB.

 $dbh->sqlite_backup_to_file( $filename )
  This method accesses the SQLite Online Backup API, and will take a
  backup of the currently connected database, and write it out to
  the named file.

 $dbh->sqlite_enable_load_extension( $bool )
  Calling this method with a true value enables loading (external)
  SQLite3 extensions. After the call, you can load extensions like
  this:

    $dbh->sqlite_enable_load_extension(1);
    $sth = $dbh->prepare("select load_extension('libsqlitefunctions.so')")
    or die "Cannot prepare: " . $dbh->errstr();

 $dbh->sqlite_load_extension( $file, $proc )
  Loading an extension by a select statement (with the
  "load_extension" SQLite3 function like above) has some
  limitations. If you need to, say, create other functions from an
  extension, use this method. $file (a path to the extension) is
  mandatory, and $proc (an entry point name) is optional. You need
  to call "sqlite_enable_load_extension" before calling
  "sqlite_load_extension".

 $dbh->sqlite_trace( $code_ref )
  This method registers a trace callback to be invoked whenever SQL
  statements are being run.

  The callback will be called as

    $code_ref->($statement)

  where

  $statement
      is a UTF-8 rendering of the SQL statement text as the
      statement first begins executing.

  Additional callbacks might occur as each triggered subprogram is
  entered. The callbacks for triggers contain a UTF-8 SQL comment
  that identifies the trigger.

  See also "TRACING" in DBI for better tracing options.

 $dbh->sqlite_profile( $code_ref )
  This method registers a profile callback to be invoked whenever a
  SQL statement finishes.

  The callback will be called as

    $code_ref->($statement, $elapsed_time)

  where

  $statement
      is the original statement text (without bind parameters).

  $elapsed_time
      is an estimate of wall-clock time of how long that statement
      took to run (in milliseconds).

  This method is considered experimental and is subject to change in
  future versions of SQLite.



( run in 0.533 second using v1.01-cache-2.11-cpan-39bf76dae61 )