Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds stubs for Pdo\Pgsql #1709

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
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
53 changes: 53 additions & 0 deletions PDO/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -2058,4 +2058,57 @@ class Mysql extends PDO

public function getWarningCount(): int {}
}

/**
* @since 8.4
*/
class Pgsql extends PDO
{
public const int ATTR_DISABLE_PREPARES = 1000;
public const int ATTR_RESULT_MEMORY_SIZE = 1001;
public const int TRANSACTION_IDLE = 0;
public const int TRANSACTION_ACTIVE = 1;
public const int TRANSACTION_INTRANS = 2;
public const int TRANSACTION_INERROR = 3;
public const int TRANSACTION_UNKNOWN = 4;

public function copyFromArray(
string $tableName,
array $rows,
string $separator = "\t",
string $nullAs = "\\\\N",
?string $fields = null
): bool {}
public function copyFromFile(
string $tableName,
string $filename,
string $separator = "\t",
string $nullAs = "\\\\N",
?string $fields = null
): bool {}
public function copyToArray(
string $tableName,
string $separator = "\t",
string $nullAs = "\\\\N",
?string $fields = null
): array|false {}
public function copyToFile(
string $tableName,
string $filename,
string $separator = "\t",
string $nullAs = "\\\\N",
?string $fields = null
): bool {}
public function escapeIdentifier(string $input): string {}
public function getNotify(int $fetchMode = \PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {}
public function getPid(): int{}
public function lobCreate(): string|false {}
/**
* Opens an existing large object stream. Must be called inside a transaction.
* @return resource|false
*/
public function lobOpen(string $oid, string $mode = "rb") {}
public function lobUnlink(string $oid): bool {}
public function setNoticeCallback(?callable $callback): void {}
}
}
1 change: 1 addition & 0 deletions PhpStormStubsMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ final class PhpStormStubsMap
'ParseError' => 'Core/Core_c.php',
'Pcntl\\QosClass' => 'pcntl/pcntl_c.php',
'Pdo\\Mysql' => 'PDO/PDO.php',
'Pdo\\Pgsql' => 'PDO/PDO.php',
'Pdo\\Sqlite' => 'PDO/PDO.php',
'PgSql\\Connection' => 'pgsql/pgsql_c.php',
'PgSql\\Lob' => 'pgsql/pgsql_c.php',
Expand Down
Loading