-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Library
- Database
- Dongle
October\Rain\Database\Dongle
Source: ~/vendor/october/rain/src/Database/Dongle.php
Database driver dongle
This class uses regex to convert MySQL to various other drivers.
Protected properties
protected DB $db
Database helper object
protected string $driver
Driver to convert to: mysql, sqlite, pgsql, sqlsrv, postgis.
protected bool $strictModeDisabled
Used to determine whether strict mode has been disabled.
Public methods
public void __construct($driver='mysql', $db=NULL)
Constructor.
Parameters
- $driver
- $db
public string cast(string $sql, $asType='INTEGER')
Some drivers require same-type comparisons.
Parameters
- string $sql
- $asType
public void convertTimestamps(string $table, string|array $columns=NULL)
Alters a table's TIMESTAMP field(s) to be nullable and converts existing values.
This is needed to transition from older Laravel code that set DEFAULT 0, which is an invalid date in newer MySQL versions where NO_ZERO_DATE is included in strict mode.
Parameters
- string $table
- string|array $columns - Column name(s). Defaults to ['created_at', 'updated_at']
public void disableStrictMode()
Used to disable strict mode during migrations
public string getDriver()
Returns the driver name as a string, eg: pgsql
public string getTablePrefix()
Get the table prefix.
public string parse(string $sql)
Transforms an SQL statement to match the active driver.
Parameters
- string $sql
public string parseBooleanExpression(string $sql)
Transforms true|false expressions in a statement.
Parameters
- string $sql
public string parseConcat(string $sql)
Transforms CONCAT statement.
Parameters
- string $sql
public string parseGroupConcat(string $sql)
Transforms GROUP_CONCAT statement.
Parameters
- string $sql
public string parseIfNull(string $sql)
Transforms IFNULL statement.
Parameters
- string $sql
public mixed raw(string $sql)
Transforms and executes a raw SQL statement
Parameters
- string $sql