class SQLiteConnector extends Connector implements ConnectorInterface (View source)

Traits

Properties

protected array $options

The default PDO connection options.

from  Connector

Methods

bool
causedByLostConnection(Throwable $e)

Determine if the given exception was caused by a lost connection.

PDO
createConnection(string $dsn, array $config, array $options)

Create a new PDO connection.

PDO
createPdoConnection(string $dsn, string $username, string $password, array $options)

Create a new PDO connection instance.

PDO
tryAgainIfCausedByLostConnection(Throwable $e, string $dsn, string $username, string $password, array $options)

Handle an exception that occurred during connect execution.

array
getOptions(array $config)

Get the PDO options based on the configuration.

array
getDefaultOptions()

Get the default PDO connection options.

void
setDefaultOptions(array $options)

Set the default PDO connection options.

PDO
connect(array $config)

Establish a database connection.

string
parseDatabasePath(string $path)

Get the absolute database path.

void
configurePragmas(PDO $connection, array $config)

Set miscellaneous user-configured pragmas.

void
configureForeignKeyConstraints(PDO $connection, array $config)

Enable or disable foreign key constraints if configured.

void
configureBusyTimeout(PDO $connection, array $config)

Set the busy timeout if configured.

void
configureJournalMode(PDO $connection, array $config)

Set the journal mode if configured.

void
configureSynchronous(PDO $connection, array $config)

Set the synchronous mode if configured.

Details

protected bool causedByLostConnection(Throwable $e)

Determine if the given exception was caused by a lost connection.

Parameters

Throwable $e

Return Value

bool

PDO createConnection(string $dsn, array $config, array $options)

Create a new PDO connection.

Parameters

string $dsn
array $config
array $options

Return Value

PDO

Exceptions

Exception

protected PDO createPdoConnection(string $dsn, string $username, string $password, array $options)

Create a new PDO connection instance.

Parameters

string $dsn
string $username
string $password
array $options

Return Value

PDO

protected PDO tryAgainIfCausedByLostConnection(Throwable $e, string $dsn, string $username, string $password, array $options)

Handle an exception that occurred during connect execution.

Parameters

Throwable $e
string $dsn
string $username
string $password
array $options

Return Value

PDO

Exceptions

Throwable

array getOptions(array $config)

Get the PDO options based on the configuration.

Parameters

array $config

Return Value

array

array getDefaultOptions()

Get the default PDO connection options.

Return Value

array

void setDefaultOptions(array $options)

Set the default PDO connection options.

Parameters

array $options

Return Value

void

PDO connect(array $config)

Establish a database connection.

Parameters

array $config

Return Value

PDO

protected string parseDatabasePath(string $path)

Get the absolute database path.

Parameters

string $path

Return Value

string

Exceptions

SQLiteDatabaseDoesNotExistException

protected void configurePragmas(PDO $connection, array $config)

Set miscellaneous user-configured pragmas.

Parameters

PDO $connection
array $config

Return Value

void

protected void configureForeignKeyConstraints(PDO $connection, array $config)

Enable or disable foreign key constraints if configured.

Parameters

PDO $connection
array $config

Return Value

void

protected void configureBusyTimeout(PDO $connection, array $config)

Set the busy timeout if configured.

Parameters

PDO $connection
array $config

Return Value

void

protected void configureJournalMode(PDO $connection, array $config)

Set the journal mode if configured.

Parameters

PDO $connection
array $config

Return Value

void

protected void configureSynchronous(PDO $connection, array $config)

Set the synchronous mode if configured.

Parameters

PDO $connection
array $config

Return Value

void

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.