MariaDB toggle SQLite3 : abstraction layer or simple toggle ?

30 views
Skip to first unread message

Emmanuel

unread,
Apr 2, 2018, 8:40:21 AM4/2/18
to Fat-Free Framework
G-day all,

How to set an abstraction layer over/around MariaDB et MySqlite3 ?

so we can then take the laptop and go for demo time to the customer awaiting data moving on screen :)

or an  abstraction  layer  over/around  MariaDB and Wi-Fi access to the same demo instance of those data? ( [risky] complicated at 1st? or can open remote access to only a  specific4demo  MariaDB  table  only ?)

Thanks in advance F3::Wizards in there

Emmaneul

P.S.
Don't want to bother , but maybe the boss ask later to toggle to MongoDB 
maybe ...
who's not willing to rewrite all the SQL queries  ;)

ved

unread,
Apr 2, 2018, 9:02:06 AM4/2/18
to Fat-Free Framework
Not really sure if I got what you're asking, but you seem to want a local version of your app running on your laptop.

You could solve that by installing a webserver and mariadb locally and just change F3's database connection parameters to use the local instance. (or use MAMP, WAMP, etc)

If you're using sqlite then all you should need is the sqlite data file and a php enabled webserver running locally.

Emmanuel

unread,
Apr 2, 2018, 10:02:48 AM4/2/18
to Fat-Free Framework
please can i extract some code from  Scheman Builder https://github.com/ikkez/f3-schema-builder#sql-schema-builder to use to write a simple db toggler thanx to your code

Emmanuel

unread,
Apr 2, 2018, 11:00:31 AM4/2/18
to f3-fra...@googlegroups.com
@ved thanks for your help

>> what you're askin

need a TRANSPARENT way to write SQL queries whatwer we use MondoDB, MariaDB  or  a filebased Sqlite3 db format. 

would ve great  to write the same SQL queries WITHOUT having to bother what is the persistance in use.

so we can later export the code to the Android App builder  with a local phone sqlite3 storage


UPDATE:  JUST  FOUND  The Smart SQL ORM , core component of F3 !  "nul n'est censé ignorer la..." as the say...
---------------


"that's exactly what the framework does "   The Smart SQL ORM   fatfreeframework.com/databases#TheSmartSQLORM



On Monday, April 2, 2018 at 6:10:21 PM UTC+5:30, Emmanuel wrote:

ved

unread,
Apr 2, 2018, 11:15:38 AM4/2/18
to Fat-Free Framework
You should use @ikkez's f3-cortex plugin which does pretty much exactly what you're asking for.

It abstracts away the differences between F3's database engines, allowing you to switch between sql, mongo or jig without having to change the query format.

It also supports relationships and a few other goodies. Definitely worth trying.

Emmanuel

unread,
Apr 2, 2018, 11:31:07 AM4/2/18
to Fat-Free Framework

Emmanuel

unread,
Apr 2, 2018, 11:34:23 AM4/2/18
to Fat-Free Framework
@ved Cortex?  uhh... not too complicated  while The Smart SQL ORM is awaiting us?


ved

unread,
Apr 2, 2018, 11:43:11 AM4/2/18
to Fat-Free Framework
Yes, a few data mappers are already included in F3. They are SQL, Mongo and Jig.

BUT: while the sql data mapper should support all databases that PHP's PDO supports, it's not interchangeable with the Mongo or Jig mappers. Mainly because Mongo and Jig aren't really SQL databases and therefore don't use the SQL language to access the data.

Ikkez's cortex plugin though, expands F3's native data mappers a bit and is able to convert SQL type queries into the Mongo and Jig engines (as well as some other features).

So, if you really want to switch between an SQL database and Mongo or Jig while using the same query code, you'll have to use cortex. If all you want is to switch between different SQL databases, then the native F3 SQL mapper should be enough.
Reply all
Reply to author
Forward
0 new messages