Skip to content

Conversation

@lacatoire
Copy link
Contributor

📝 Description de la Pull Request

This PR adds missing constants for the PDO_SQLITE driver that are currently available in PHP but not documented.

Issue: #1394

Newly added constants:

PDO::SQLITE_ATTR_OPEN_FLAGS
PDO::SQLITE_OPEN_READONLY
PDO::SQLITE_OPEN_READWRITE
PDO::SQLITE_OPEN_CREATE
PDO::SQLITE_ATTR_READONLY_STATEMENT
PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES
PDO::SQLITE_DETERMINISTIC

@devnexen
Copy link
Member

devnexen commented Nov 22, 2025

Note these are deprecated since 8.5 ; basically PDO::... => Pdo\Sqlite::... (see here in the PDO section),

Comment on lines 92 to 164
<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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow what https://www.php.net/manual/en/ref.pdo-pgsql.php does and just point to the Pdo\Sqlite constants, that do need to be documented.

Note for some reason PDO::SQLITE_DETERMINISTIC is documented with the generic PDO constants and should be removed from there.

Copy link
Contributor Author

@lacatoire lacatoire Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Girgias i've removed PDO::SQLITE_DETERMINISTIC, but sorry for the first comment, i don't get it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants