laravel-cross-eloquent-search
laravel-cross-eloquent-search copied to clipboard
Support SQLite3
Hej,
are there any plans to support SQLite3 as database driver? I am developing my apps with SQLite3 on my machine and with MySQL on the production server. So far I cannot use this package as much as I would like to. And I don't think that I would be this hard:
- use
LENGTH()instead ofCHAR_LENGTH() - escape column names because SQLite3 does not support a number as the first character of a column name
If you would like I could create a pull request. I only need one hint: where are the columns like 0_post_key are defined? Couldn't find it for now.
Okay, I tried successfully to adjust it for SQLite3 and it was quite easy:
- ~I prefixed the column names with a single character:
0_post_keygota0_post_key~ - => get the grammar and wrap the column name (
$builder->getGrammar()->wrap( $column )) - I added a single
NULLin theCOALESCE()function because SQLite3 expects at least two arguments - use
LENGTH()instead ofCHAR_LENGTH()
... and that is nearly all. I discovered an issue for modules that don't have timestamp column (EDIT: created an issue for this #39). Will further invest into this tomorrow.