Which SQL Database Systems Are Supported for Import in the Exercises Dataset?
The Exercises Dataset supports SQL Server, PostgreSQL, MySQL, and SQLite for import, automatically generating compatible CREATE TABLE schemas and 1,324 bulk INSERT statements tailored to each engine's specific syntax.
The hasaneyldrm/exercises-dataset repository includes a built-in import wizard that eliminates manual schema translation when integrating fitness exercise data into relational databases. Understanding which SQL database systems are supported for import enables developers to deploy the dataset across diverse infrastructure stacks using native SQL generation features implemented in the source code.
Supported SQL Database Engines
The project maintains dedicated SQL templates for four major database systems, each identified by a specific dbKey referenced throughout the JavaScript implementation.
Microsoft SQL Server
SQL Server (identifier: mssql) receives specialized transaction handling. The generated script implements 50-row batch commits to ensure compatibility with SQL Server's transaction log management and memory optimization. According to the source code in setup.html【/cache/repos/github.com/hasaneyldrm/exercises-dataset/main/setup.html#L530-L533】, this option appears as a selectable tab in the Database Setup interface.
PostgreSQL
PostgreSQL (identifier: postgresql) receives standard CREATE TABLE and bulk INSERT statements following PostgreSQL-specific syntax requirements. The output executes without modification in psql, pgAdmin, or any standard PostgreSQL client.
MySQL
MySQL (identifier: mysql) produces MySQL-compatible CREATE TABLE definitions and INSERT statements. The generated SQL works with MySQL 5.7+ and MariaDB implementations without requiring dialect modifications.
SQLite
SQLite (identifier: sqlite) generates lightweight CREATE TABLE and INSERT statements optimized for file-based databases. This option supports local development environments and embedded applications requiring zero-configuration database setup.
How the SQL Generation Works
The import functionality relies on a centralized DB_SQL JavaScript object defined in setup.html【/cache/repos/github.com/hasaneyldrm/exercises-dataset/main/setup.html#L735-L739】. This object stores the complete schema and all data rows for each supported engine.
When a user initiates the export function, the script reads the selected dbKey (one of mssql, postgresql, mysql, or sqlite) and retrieves the corresponding template from DB_SQL[dbKey]. The implementation includes safety recommendations for using parameterised queries【/cache/repos/github.com/hasaneyldrm/exercises-dataset/main/setup.html#L1452】 when adapting the generated SQL for production environments.
Accessing SQL Templates Programmatically
Developers can access the SQL generation logic directly through the global DB_SQL object available in both setup.html and index.html.
The following example demonstrates how to retrieve the PostgreSQL import script:
// The DB_SQL object holds the CREATE/INSERT templates for each engine
const DB_SQL = {
mssql: `CREATE TABLE exercises (...);\n-- INSERT statements`,
postgresql: `CREATE TABLE exercises (...);\n-- INSERT statements`,
mysql: `CREATE TABLE exercises (...);\n-- INSERT statements`,
sqlite: `CREATE TABLE exercises (...);\n-- INSERT statements`
};
// Example: generate the SQL for PostgreSQL
const dbKey = 'postgresql';
const sqlScript = DB_SQL[dbKey];
console.log(`--- PostgreSQL import script ---\n${sqlScript}`);
The UI binds these templates to interactive tab buttons. In both setup.html【/cache/repos/github.com/hasaneyldrm/exercises-dataset/main/setup.html#L530-L533】 and index.html【/cache/repos/github.com/hasaneyldrm/exercises-dataset/main/index.html#L1102-L1105】, the following HTML structure allows users to select their target database:
<!-- Database selection tabs -->
<button class="tab-btn active" data-db="mssql" role="tab">SQL Server</button>
<button class="tab-btn" data-db="postgresql" role="tab">PostgreSQL</button>
<button class="tab-btn" data-db="mysql" role="tab">MySQL</button>
<button class="tab-btn" data-db="sqlite" role="tab">SQLite</button>
When the Generate INSERT SQL button activates, the application copies the selected template to the clipboard using the copyToClipboard utility:
copyCreateBtn.addEventListener('click', () => {
copyToClipboard(DB_SQL[currentDb], copyCreateBtn);
});
Key Implementation Files
The SQL import functionality spans two primary files in the repository:
setup.html: Contains the Database Setup section with engine selection tabs and the centralizedDB_SQLobject definition at lines 735-739index.html: Mirrors the SQL Generation panel functionality at lines 1102-1105, providing the same tab-based engine selection for quick browser-based testing
Summary
- Four SQL database systems are supported for import: SQL Server (
mssql), PostgreSQL (postgresql), MySQL (mysql), and SQLite (sqlite) - SQL Server receives special handling with 50-row transaction batches for optimal compatibility
- Templates are stored in the
DB_SQLJavaScript object defined insetup.htmlat lines 735-739 - UI selection appears in both
setup.html(lines 530-533) andindex.html(lines 1102-1105) with tab-based database selection - The system generates 1,324 INSERT statements plus the complete
CREATE TABLEschema for the chosen engine
Frequently Asked Questions
Can I import the exercises dataset into Oracle or other SQL databases?
The built-in wizard only generates SQL for SQL Server, PostgreSQL, MySQL, and SQLite. For Oracle or other systems, you can export the SQLite format and use migration tools, or adapt the generated CREATE TABLE syntax manually using the PostgreSQL template as a reference structure.
Does the SQL Server export support Azure SQL Database?
Yes, the mssql export format uses standard T-SQL compatible with both on-premises SQL Server and Azure SQL Database. The 50-row batch commits specifically help manage transaction limits common in cloud-hosted instances.
Where is the actual SQL template data stored?
The SQL templates reside in the DB_SQL JavaScript object defined in setup.html at lines 735-739. This object contains the complete CREATE TABLE statement and all 1,324 INSERT rows for each of the four supported database engines.
Is there a way to generate partial imports instead of all 1,324 rows?
The current implementation in setup.html and index.html generates the complete dataset. To create partial imports, you would need to modify the DB_SQL[dbKey] string after retrieval or post-process the generated SQL to filter specific exercise categories before execution.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →