Davis Harrison Dion 3 Posted November 24, 2020 Hello, We're setting up a PW app that has a dozen sqlite databases it will use for various tasks and analytics. Does anyone know if there are any modules with any sqlite connectivity in them? I haven't seen any on first glance. I know this is nebulous, but is there any advise on how to best "fold in" sqlite connectivity AND data into PW's existing structure? Thanks! Share this post Link to post Share on other sites
netcarver 2,700 Posted November 24, 2020 @Davis Harrison Dion Hello, whilst there has been sporadic chat in the forums regarding sqlite over the years, I don't think we are any closer to seeing core support for it. I'm also unaware of any third party integration that's using it. I'd be delighted if I were wrong about that though; perhaps someone lurking in here does know how it can be done. 1 Share this post Link to post Share on other sites
Davis Harrison Dion 3 Posted November 24, 2020 @netcarver Thanks! That's what I sort of thought. This project/client uses sqlite db's to sling datasets between apps and clients. I can certainly whip up some connectivity, but I would like to module-ize it and I'm not sure how to do it in such a way to be useful to anyone else. Share this post Link to post Share on other sites
adrian 11,960 Posted November 24, 2020 Note sure if it suits your needs or not, but it's really easy to include https://dibiphp.com/ into PW and then you can query those sqlite databases within your template files / modules. You can put this in your init.php file: require_once __DIR__ . '/vendor/autoload.php'; $this->wire("dibi", new Dibi\Connection([ 'driver' => 'sqlite', 'host' => hostname, 'username' => user, 'password' => pass, 'database' => dbname, ])); and then you can query using the global $dibi variable like this: $result = $dibi->query('SELECT * FROM mytable'); foreach ($result as $row) { echo $row->fieldname; } 7 Share this post Link to post Share on other sites
Davis Harrison Dion 3 Posted December 1, 2020 On 11/24/2020 at 3:03 PM, adrian said: Note sure if it suits your needs or not, but it's really easy to include https://dibiphp.com/ into PW and then you can query those sqlite databases within your template files / modules. You can put this in your init.php file: @adrian This is really neat...thanks for posting! 1 Share this post Link to post Share on other sites
pwired 1,299 Posted December 2, 2020 Thanks Adrian for posting about this dibiphp, was looking for this for a long time. Share this post Link to post Share on other sites