SQLize Embed Documentation
SQLize Embed is a lightweight, responsive SQL editor and executor that you can embed into any website. It allows your users to run SQL queries against various database engines directly in their browser.
Key Features
- Multi-Engine Support: Supports MySQL (8.0, 9.3), PostgreSQL (14-18), MS SQL Server, MariaDB (11.4, 11.8), SQLite, Oracle, Firebird, ClickHouse, and more.
- Ready-to-Use Datasets: Access preloaded databases like Sakila, OpenFlights, and Bookings.
- Responsive Design: Works on desktops and mobile devices.
- Dynamic Initialization: Automatically detects new editors added to the page via AJAX or infinite scroll.
- Ace Editor Powered: High-quality code highlighting and editing experience.
Getting Started
1. Include the Script
Add the following script tag to the <head> or before the closing </body> tag of your website:
<script src="https://api.sqlize.online/js/sqlize-embed.js"></script>
2. Add an Editor Container
Create a div element with the data-sqlize-editor attribute. You can specify the database version and the number of visible rows for the editor.
<div data-sqlize-editor
data-sql-version="mysql80"
code-rows="10">
SELECT * FROM sakila.actor LIMIT 5;
</div>
Configuration Attributes
| Attribute | Description | Default |
|---|---|---|
data-sqlize-editor |
Required attribute to identify the container as an editor. | N/A |
data-sql-version |
The database engine to use (e.g., mysql80, psql17, sqlite3). |
mysql80 |
code-rows |
The fixed number of lines the editor should display. | 12 |
result-rows |
The fixed number of lines the result block should display. | 12 |
data-read-only |
Set to true to disable editing. |
false |
Supported Database Versions
Use these values in the data-sql-version attribute:
| Value | Database Engine |
|---|---|
mysql80 | MySQL 8.0 |
mysql93 | MySQL 9.3.0 |
mariadb123 | MariaDB 12.3 |
mariadb118 | MariaDB 11.8 |
mariadb | MariaDB 10 |
psql14 | PostgreSQL 14 |
psql15 | PostgreSQL 15 |
psql16 | PostgreSQL 16 |
psql17 | PostgreSQL 17 + PostGIS |
psql18 | PostgreSQL 18 |
mssql2017 | MS SQL Server 2017 |
mssql2019 | MS SQL Server 2019 |
mssql2022 | MS SQL Server 2022 |
mssql2025 | MS SQL Server 2025 |
sqlite3 | SQLite 3 |
oracle21 | Oracle Database 21c |
oracle23 | Oracle Database 26ai |
firebird4 | Firebird 4.0 |
firebird5 | Firebird 5.0 |
clickhouse | ClickHouse |
Note: Preloaded datasets like mysql80_sakila, mariadb118_openflights, and psql10demo are also available.
Use Cases
Educational Blogs & Tutorials
Perfect for teaching SQL. Provide interactive examples where students can modify queries and see results instantly without installing any software.
Documentation for Database Tools
Include "Try it now" sections in your documentation to demonstrate specific features of a database engine.
Portfolio & Technical Interviewing
Showcase complex SQL queries in your blog or use it as a simple platform for technical assessments.
Pricing Policy
SQLize Embed is distributed on a paid subscription basis.
- Per-Domain Licensing: A subscription is required for each top-level domain where the script is hosted.
- On-Demand Pricing: We offer flexible pricing based on your traffic and usage requirements.
For a custom quote and to obtain your license key, please contact us at support@sqlize.com.
Examples
PostgreSQL with PostGIS
<div data-sqlize-editor data-sql-version="psql17" code-rows="5">
SELECT postgis_full_version();
</div>
SQLite (Empty Editor)
<div data-sqlize-editor data-sql-version="sqlite3">
-- Type your SQLite query here
</div>
Read-Only Editor
<div data-sqlize-editor data-sql-version="mysql80" data-read-only="true">
-- This code cannot be edited
SELECT 'You can see me, but you can\'t touch me!' as message;
</div>
License
This script utilizes the Ace Editor, which is licensed under the BSD 3-Clause License. By using this script, you agree to the SQLize Embed Terms of Service.
SQLize.online Embedding Example
This page demonstrates how to embed an interactive SQL editor using the sqlize-embed.js script.
You can specify the database version using the data-sql-version attribute.
1. MySQL 8.0 Example
2. PostgreSQL 15 Example
3. MariaDB 11.8 Example with Vector Type
4. Read-Only Example
This editor is set to data-read-only="true", meaning you can run the query but not modify it.
5. Custom Result Height Example
This editor uses result-rows="6" to make the result block smaller than the default.
How to use:
- Include the script:
<script src="/js/sqlize-embed.js"></script> - Add a container:
<div data-sqlize-editor data-sql-version="mysql80">SELECT ...</div>