Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Ask Reuben 23 - SQLite In-memory Database  (Read 3790 times)
Reuben B.
Four Js
Posts: 1046


« on: May 14, 2020, 07:46:08 am »

With libraries, samples etc that are in the FourJs Genero GitHub repository such as fgl_zoom, we need to run the program against a database.  However we want the program to run out of the box, we don't want you to have to configure to your own databases or to have to cater for database differences not catered for by the ODI layer   We want the repository to be as simple as possible so that it can be downloaded, compiled, and executed in 3 simple steps.

A technique I use is to take advantage of the fact that SQLite has a built-in in-memory database.  That is rather than having the SQLite database stored in an ordinary disk file, it is stored in memory.  With SQLite this is achieved with a special database filename of ":memory:".  For our Genero configuration this simply means that when specifying a connection to a SQLite database to also use this special filename of ":memory:” . You will see this in our repositories with a line of code ...

Code
  1. CONNECT TO “:memory:+driver=‘dbmsqt’ "

This in-memory database has a lot of potential uses.

Read more at https://4js.com/ask-reuben/ig-23/

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines