Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 171 additions & 96 deletions reference/pdo_sqlite/reference.xml
Original file line number Diff line number Diff line change
@@ -1,114 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<reference xml:id="ref.pdo-sqlite" xmlns="http://docbook.org/ns/docbook">
<?phpdoc extension-membership="bundledexternal" ?>
<title>SQLite PDO Driver (PDO_SQLITE)</title>
<titleabbrev>SQLite PDO Driver</titleabbrev>
<partintro>
<reference xml:id="ref.pdo-sqlite" xmlns="http://docbook.org/ns/docbook">
<?phpdoc extension-membership="bundledexternal" ?>
<title>SQLite PDO Driver (PDO_SQLITE)</title>
<titleabbrev>SQLite PDO Driver</titleabbrev>
<partintro>

<section xml:id="ref.pdo-sqlite.intro">
<section xml:id="ref.pdo-sqlite.intro">
&reftitle.intro;
<para>
PDO_SQLITE is a driver that implements the <link linkend="intro.pdo">PHP
Data Objects (PDO) interface</link> to enable access to SQLite 3 databases.
</para>
<note>
<para>
PDO_SQLITE is a driver that implements the <link linkend="intro.pdo">PHP
Data Objects (PDO) interface</link> to enable access to SQLite 3 databases.
PDO_SQLITE allows using strings apart from streams together with
<constant>PDO::PARAM_LOB</constant>.
</para>
<note>
<para>
PDO_SQLITE allows using strings apart from streams together with
<constant>PDO::PARAM_LOB</constant>.
</para>
</note>
</section>
</note>
</section>

&reference.pdo-sqlite.configure;
&reference.pdo-sqlite.configure;

</partintro>
</partintro>

<refentry xml:id="ref.pdo-sqlite.connection">
<refnamediv>
<refname>PDO_SQLITE DSN</refname>
<refpurpose>Connecting to SQLite databases</refpurpose>
</refnamediv>
<refentry xml:id="ref.pdo-sqlite.connection">
<refnamediv>
<refname>PDO_SQLITE DSN</refname>
<refpurpose>Connecting to SQLite databases</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<para>
The PDO_SQLITE Data Source Name (DSN) is composed of the following elements:
<variablelist>
<varlistentry>
<term>DSN prefix (SQLite 3)</term>
<listitem>
<para>
The DSN prefix is <userinput>sqlite:</userinput>.
<itemizedlist>
<listitem>
<para>
To access a database on disk, the absolute path has to be appended to the
DSN prefix.
</para>
</listitem>
<listitem>
<para>
To create a database in memory, <literal>:memory:</literal> has to be appended
to the DSN prefix.
</para>
</listitem>
<listitem>
<para>
If the DSN consists of the DSN prefix only, a temporary database is used,
which is deleted when the connection is closed.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>PDO_SQLITE DSN examples</title>
<para>
The following examples show PDO_SQLITE DSN for connecting to
SQLite databases:
<programlisting>
<![CDATA[
<refsect1 role="description">
&reftitle.description;
<para>
The PDO_SQLITE Data Source Name (DSN) is composed of the following elements:
<variablelist>
<varlistentry>
<term>DSN prefix (SQLite 3)</term>
<listitem>
<para>
The DSN prefix is <userinput>sqlite:</userinput>.
<itemizedlist>
<listitem>
<para>
To access a database on disk, the absolute path has to be appended to the
DSN prefix.
</para>
</listitem>
<listitem>
<para>
To create a database in memory, <literal>:memory:</literal> has to be appended
to the DSN prefix.
</para>
</listitem>
<listitem>
<para>
If the DSN consists of the DSN prefix only, a temporary database is used,
which is deleted when the connection is closed.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>PDO_SQLITE DSN examples</title>
<para>
The following examples show PDO_SQLITE DSN for connecting to
SQLite databases:
<programlisting>
<![CDATA[
sqlite:/opt/databases/mydb.sq3
sqlite::memory:
sqlite:
]]>
</programlisting>
</para>
</example>
</para>
</refsect1>
</refentry>
</programlisting>
</para>
</example>
</para>
</refsect1>
</refentry>

<section xml:id="ref.pdo-sqlite.constants">
&reftitle.constants;

<constant>
<name>PDO::SQLITE_ATTR_OPEN_FLAGS</name>
<description>
Allows control over how the SQLite database file is opened.
Accepts a bitmask combination of <constant>PDO::SQLITE_OPEN_READONLY</constant>,
<constant>PDO::SQLITE_OPEN_READWRITE</constant>, and
<constant>PDO::SQLITE_OPEN_CREATE</constant>.
</description>
<since version="7.3.0"/>
<seealso>
<link xlink:href="https://www.sqlite.org/c3ref/open.html">SQLite open flags</link>
</seealso>
</constant>

<constant>
<name>PDO::SQLITE_OPEN_READONLY</name>
<description>
Opens the database in read-only mode. Fails if the database does not exist.
</description>
<since version="7.3.0"/>
</constant>

<constant>
<name>PDO::SQLITE_OPEN_READWRITE</name>
<description>
Opens the database in read/write mode. Fails if the database does not exist.
</description>
<since version="7.3.0"/>
</constant>

<constant>
<name>PDO::SQLITE_OPEN_CREATE</name>
<description>
Creates the database if it does not exist.
</description>
<since version="7.3.0"/>
</constant>

<constant>
<name>PDO::SQLITE_ATTR_READONLY_STATEMENT</name>
<description>
Returns whether a prepared statement is read-only.
</description>
<since version="7.4.0"/>
</constant>

<constant>
<name>PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES</name>
<description>
Enables or disables the use of extended result codes in SQLite.
</description>
<since version="7.4.0"/>
<seealso>
<link xlink:href="https://www.sqlite.org/rescode.html">SQLite result and extended result codes</link>
</seealso>
</constant>

<constant>
<name>PDO::SQLITE_DETERMINISTIC</name>
<description>
Indicates that a user-defined function behaves deterministically, which allows
SQLite to perform additional optimizations.
</description>
<since version="7.1.4"/>
<seealso>
<link xlink:href="https://www.sqlite.org/c3ref/create_function.html">sqlite3_create_function()</link>
</seealso>
</constant>

</section>

&reference.pdo-sqlite.entities.pdo-overloaded;

</reference>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
</reference>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->