Download the PHP package max13/laravel-sqfix without Composer
On this page you can find all versions of the php package max13/laravel-sqfix. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download max13/laravel-sqfix
More information about max13/laravel-sqfix
Files in max13/laravel-sqfix
Package laravel-sqfix
Short Description Laravel package fixing SQLite Schema grammar
License MIT
Homepage https://github.com/max13/laravel-sqfix
Informations about the package laravel-sqfix
Laravel package fixing SQLite Schema grammar
SQLite
has many quirks, some of them are bugs and stayed like this because of legacy code, bugs that became features, etc… See the complete list on their website:
ROWID
s: Every table (except explicitely createdWITHOUT ROWID
) have a 64-bit signed integer column namedrowid
. This column has the same attributes expected for aPRIMARY KEY
(starts at1
, is anINTEGER
, isUNIQUE
across the table, and is usually incremented by1
on every insert), and can reuse (in certain condition) previously deletedrowid
s. Only the exact type (case insensitive)INTEGER PRIMARY KEY
will make a column an alias ofrowid
. Which is recommended in most cases.AUTOINCREMENT
: When this keyword is used, it will use a different algorithm forrowid
, briefly, anAUTOINCREMENT
will makeSQLite
create an table used to track the increments (sqlite_sequence
),rowid
s are guaranteed to be increasing and never reused. The AUTOINCREMENT keyword imposes extra CPU, memory, disk space, and disk I/O overhead and should be avoided if not strictly needed. It is usually not needed.
This package replaces the default optimized behavior advised by SQLite
and will have no effect on other drivers. Laravel
’s ids are automatically created as aliases of rowid
, and the ->trueSyntax()
modifier will use the "unfixed" SQL grammar.
Installation
You can install the package via composer:
That’s it!
Usage
The normal behavior of Laravel
is to define the table jobs
with the following statement:
Which will both create a column named id
distinct from rowid
with the same properties. Double the work.
This package is making Laravel
produce the following table:
Optimisation max.
Testing
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.