Retool supports connect to a sqlite db?

how i can connect retool to a sqlite db?

@victoria @PeteTheHeat @Kabirdas

Hi there,

Connecting Retool to an SQLite database currently requires some workarounds as there isn't a direct integration available yet. I understand that this isn't ideal, and I apologize for any inconvenience it may cause.

Here are your options:

1. Host your SQLite database in the cloud:

If you can host your SQLite database on a cloud platform like Azure, AWS, or GCP, you can then connect to it from Retool using their respective database integrations. You can find guides on setting up SQLite on these platforms here.

2. Import SQLite files to AWS S3 and connect through Retool:
While there's no native SQLite integration, you can import your SQLite files into an S3 bucket on AWS and connect to that from Retool. Here's the documentation for this approach.

3. Consider migrating to MySQL:
Retool offers a direct integration with MySQL, which might be a good alternative if you're open to migrating your data. You can find the documentation for MySQL integration here.

Native SQLite Integration Request:

I understand that several users have requested a native SQLite integration, and your request will be added to the existing feedback. While we don't have a specific timeline for this feature due to other priorities, your feedback helps us prioritize future development efforts.

I hope this information helps!

1 Like

thank you @Lynn_Wellhausen !

You're very welcome!

Hey folks - Testing this out a bit, this is already possible for self-hosted deployments via our generic JDBC connector, but isn't available for cloud-hosted yet as we'd need a place to store the DB files (might explore integrating with Retool Storage at some point, but no set timeline on that at this point).

For self-hosted, you just need to grab a SQLite JDBC driver .jar file (can google around for it), mount that/the DB files to your db-connector container, and set the container path to the .jar file in the JDBC_DIRECTORY_PATH environment variable.

Once that's all in place for your deployment, you can connect to the file with a resource similar to:

Where the schema query is crafted to return the column/table data from the SQLite DB to use when working with queries in apps:

WITH tables AS (
  SELECT name table_name 
  FROM sqlite_schema
  WHERE type = 'table'
  AND table_name NOT LIKE 'sqlite_%'
)
SELECT
  table_name,  
  columns.name column_name,
  columns.type data_type,
  'sqlite' table_schema
FROM tables
CROSS JOIN pragma_table_info(tables.table_name) columns
1 Like

Nice idea