Install

Run the following command to install the connector from the root of your project:

npm install --save @latitude-data/sqlite-connector

How to configure sources

The sources files must be inside the queries/ folder.

To know how the source hierarchy works, please, visit How to configure sources.

Configuration

To configure the connection with your SQLite database follow these steps:

1

Create the source `.yaml` file within the `queries` folder if you haven't already

/queries/source.yml

2

Add the following code for your SQLite connection

type: sqlite 
details: 
  url: string 
3

Replace the details section with your info and save

4

Done, now you can test your connection

Attributes

  • URL → (Optional) The file path of the SQLite database on your system. SQLite is a file-based database, so instead of connecting to a server, you specify the path to the database file your application should use. This path can be absolute, pointing exactly where the file is located on the filesystem, or relative, based on the current working directory of your application. In its absence, SQLite starts a new database in memory that will not get persisted once the connection is closed.

Test connection

To test the connection you can:

  1. Create a query .sql in the queries directory that points to a table of your new connection in the FROM clause. See the section SQL Syntax Basics to learn more.
  2. Use the command line to run latitude run query_file_name where query_file_name is the name of your .sql file. This will display the results in your terminal. See the section Running queries to learn more about how to query your data.