{"id":22282059,"url":"https://github.com/sqlpage/sqlpage","last_synced_at":"2026-03-08T13:04:00.174Z","repository":{"id":60221670,"uuid":"519912039","full_name":"sqlpage/SQLPage","owner":"sqlpage","description":"Fast SQL-only data application builder. Automatically build a UI on top of SQL queries. ","archived":false,"fork":false,"pushed_at":"2025-05-05T15:59:13.000Z","size":65636,"stargazers_count":2138,"open_issues_count":93,"forks_count":137,"subscribers_count":35,"default_branch":"main","last_synced_at":"2025-05-05T16:22:50.331Z","etag":null,"topics":["database","framework","mysql","postgresql","server","serverless","sql","sqlite","web"],"latest_commit_sha":null,"homepage":"https://sql-page.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sqlpage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-31T23:50:19.000Z","updated_at":"2025-05-05T15:59:11.000Z","dependencies_parsed_at":"2024-01-19T13:47:05.021Z","dependency_job_id":"2fa3cbc1-83b4-409a-bc15-c1fab3a5cfb2","html_url":"https://github.com/sqlpage/SQLPage","commit_stats":{"total_commits":211,"total_committers":1,"mean_commits":211.0,"dds":0.0,"last_synced_commit":"b93c673abb04b9bc70c4549c1a58eb1c06b8c1a5"},"previous_names":["sqlpage/sqlpage"],"tags_count":88,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2FSQLPage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2FSQLPage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2FSQLPage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2FSQLPage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqlpage","download_url":"https://codeload.github.com/sqlpage/SQLPage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010823,"owners_count":21999003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","framework","mysql","postgresql","server","serverless","sql","sqlite","web"],"created_at":"2024-12-03T16:25:06.281Z","updated_at":"2026-03-08T13:04:00.166Z","avatar_url":"https://github.com/sqlpage.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003e\nSQLpage\n\u003c/h1\u003e\n\n[![A short video explaining the concept of sqlpage](./docs/sqlpage.gif)](./docs/sqlpage.mp4)\n\n[SQLPage](https://sql-page.com) is an **SQL**-only webapp builder.\nIt allows building powerful data-centric user interfaces quickly,\nby tranforming simple database queries into interactive websites.\n\nWith SQLPage, you write simple `.sql` files containing queries to your database\nto select, group, update, insert, and delete your data, and you get good-looking clean webpages\ndisplaying your data as text, lists, grids, plots, and forms.\n\n## Examples\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\u003ctd\u003eCode\u003ctd\u003eResult\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```sql\nSELECT \n    'list' as component,\n    'Popular websites' as title;\nSELECT \n    name as title,\n    url as link,\n    CASE type\n      WHEN 1 THEN 'blue'\n      ELSE 'red'\n    END as color,\n    description, icon, active\nFROM website;\n```\n\n\u003ctd\u003e\n    \n![SQLPage list component](./docs/demo-list.png)\n\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```sql\nSELECT\n  'chart' as component,\n  'Quarterly Revenue' as title,\n  'area' as type;\n\nSELECT\n    quarter AS x,\n    SUM(revenue) AS y\nFROM finances\nGROUP BY quarter\n```\n\n\u003ctd\u003e\n\n![SQLPage list component](./docs/demo-graph.png)\n\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```sql\nSELECT\n    'form' as component,\n    'User' as title,\n    'Create new user' as validate;\n\nSELECT\n    name, type, placeholder,\n    required, description\nFROM user_form;\n\nINSERT INTO user\nSELECT $first_name, $last_name, $birth_date\nWHERE $first_name IS NOT NULL;\n```\n\n\u003ctd\u003e\n\n![SQLPage list component](./docs/demo-form.png)\n\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```sql\nselect 'tab' as component, true as center;\nselect 'Show all cards' as title, '?' as link,\n  $tab is null as active;\nselect\n  format('Show %s cards', color) as title,\n  format('?tab=%s', color) as link,\n  $tab=color as active\nfrom tab_example_cards\ngroup by color; \n\n\nselect 'card' as component;\nselect\n  title, description, color\n  image_url as top_image, link\nfrom tab_example_cards\nwhere $tab is null or $tab = color;\n\nselect\n  'text' as component,\n  sqlpage.read_file_as_text('footer.md') as contents_md\n```\n\n\u003ctd\u003e\n\n![card component sql example](./docs/cards.png)\n\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n## Supported databases\n\n- [SQLite](https://www.sqlite.org/index.html), including the ability to [load extensions](./configuration.md) such as *Spatialite*.\n- [PostgreSQL](https://www.postgresql.org/), and other compatible databases such as *YugabyteDB*, *CockroachDB* and *Aurora*.\n- [MySQL](https://www.mysql.com/), and other compatible databases such as *MariaDB* and *TiDB*.\n- [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server), and all compatible databases and providers such as *Azure SQL* and *Amazon RDS*.\n- Any **ODBC-compatible database**, such as\n[*ClickHouse*](https://github.com/ClickHouse/clickhouse-odbc),\n[*MongoDB*](https://www.mongodb.com/docs/atlas/data-federation/query/sql/drivers/odbc/connect),\n[*DuckDB*](https://duckdb.org/docs/stable/clients/odbc/overview.html),\n[*Oracle*](https://www.oracle.com/database/technologies/releasenote-odbc-ic.html),\n[*Snowflake*](https://docs.snowflake.com/en/developer-guide/odbc/odbc),\n[*BigQuery*](https://cloud.google.com/bigquery/docs/reference/odbc-jdbc-drivers),\n[*IBM DB2*](https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information), and many others through their respective ODBC drivers.\n\n## Get started\n\n[Read the official *get started* guide on SQLPage's website](https://sql-page.com/get_started.sql).\n\n### Using executables\n\nThe easiest way to get started is to download the latest release from the\n[releases page](https://github.com/sqlpage/SQLPage/releases).\n\n- Download the binary that corresponds to your operating system (linux, macos, or windows).\n- Uncompress it: `tar -xzf sqlpage-*.tgz`\n- Run it: `./sqlpage.bin`\n\n### With docker\n\nTo run on a server, you can use [the docker image](https://hub.docker.com/r/lovasoa/SQLPage):\n\n- [Install docker](https://docs.docker.com/get-docker/)\n- In a terminal, run the following command:\n  - `docker run -it --name sqlpage -p 8080:8080 --volume \"$(pwd):/var/www\" --rm lovasoa/sqlpage`\n  - (`\"$(pwd):/var/www\"` allows sqlpage to run sql files from your current working directory)\n- Create a file called index.sql with the contents from [this example](./index.sql)\n- Open https://localhost:8080 in your browser\n- Optionally, you can also mount a directory containing sqlpage's configuration file,\n  custom components, and migrations\n  (see [configuration.md](./configuration.md)) to `/etc/sqlpage` in the container.\n     - For instance, you can use:\n       - `docker run -it --name sqlpage -p 80:8080 --volume \"$(pwd)/source:/var/www\" --volume \"$(pwd)/configuration:/etc/sqlpage:ro\" --rm lovasoa/sqlpage`\n     - And place your website in a folder named `source` and your `sqlpage.json` in a folder named `configuration`.\n- If you want to build your own docker image, taking the raw sqlpage image as a base is not recommended, since it is extremely stripped down and probably won't contain the dependencies you need. Instead, you can take debian as a base and simply copy the sqlpage binary from the official image to your own image:\n  - ```Dockerfile\n    FROM debian:stable-slim\n    COPY --from=lovasoa/sqlpage:main /usr/local/bin/sqlpage /usr/local/bin/sqlpage\n    ``` \n\nWe provide compiled binaries only for the x86_64 architecture, but provide docker images for other architectures, including arm64 and armv7. If you want to run SQLPage on a Raspberry Pi or \na cheaper ARM cloud instance, using the docker image is the easiest way to do it.\n\n### On Mac OS, with homebrew\n\nAn alternative for Mac OS users is to use [SQLPage's homebrew package](https://formulae.brew.sh/formula/sqlpage).\n\n- [Install homebrew](https://brew.sh/)\n- In a terminal, run the following commands:\n  - `brew install sqlpage`\n\n\n### ODBC Setup\n\nSQLPage supports ODBC connections to connect to databases that don't have native drivers.\nYou can skip this section if you want to use one of the built-in database drivers (SQLite, PostgreSQL, MySQL, Microsoft SQL Server).\n\nLinux and MacOS release binaries conatain a built-in statically linked ODBC driver manager (unixODBC).\nYou still need to install or provide the database-specific ODBC driver for the database you want to connect to.\n\n#### Install your ODBC database driver\n  - [DuckDB](https://duckdb.org/docs/stable/clients/odbc/overview.html)\n    - If you use docker, a DuckDB-enabled image variant is available with pre-installed DuckDB ODBC drivers\n        - Use the `-duckdb` suffix: `lovasoa/sqlpage:main-duckdb` or `lovasoa/sqlpage:latest-duckdb`\n        - Comes pre-configured to connect to DuckDB at `/var/lib/sqlpage/duckdb.db` inside the container\n        - To customize [connection options](https://duckdb.org/docs/stable/clients/odbc/configuration), set `DATABASE_URL`:\n          - `docker run -e DATABASE_URL=\"Driver=DuckDB;Database=/path/to/your.db\" -p 8080:8080 lovasoa/sqlpage:main-duckdb`\n        - To persist your DuckDB database, mount a volume:\n          - `docker run -v ./data:/var/lib/sqlpage lovasoa/sqlpage:main-duckdb`\n  - [Snowflake](https://docs.snowflake.com/en/developer-guide/odbc/odbc)\n  - [BigQuery](https://cloud.google.com/bigquery/docs/reference/odbc-jdbc-drivers)\n  - For other databases, follow your database's official odbc install instructions.\n\n#### Connect to your database\n\n - Find your [connection string](https://www.connectionstrings.com/).\n   - It will look like this: `Driver=/opt/snowflake_odbc/lib/libSnowflake.so;Server=xyz.snowflakecomputing.com;Database=MY_DB;Schema=PUBLIC;UID=my_user;PWD=my_password`\n   - It must reference the path to the database driver you installed earlier, plus any connection parameter required by the driver itself. Follow the instructions from the driver's own documentation.\n - Use it in the [DATABASE_URL configuration option](./configuration.md)\n\n\n## How it works\n\n![architecture diagram](./docs/architecture-detailed.png)\n\nSQLPage is a [web server](https://en.wikipedia.org/wiki/Web_server) written in\n[rust](https://en.wikipedia.org/wiki/Rust_(programming_language))\nand distributed as a single executable file.\nWhen it receives a request to a URL ending in `.sql`, it finds the corresponding\nSQL file, runs it on the database,\npassing it information from the web request as SQL statement parameters.\nWhen the database starts returning rows for the query,\nSQLPage maps each piece of information in the row to a parameter\nin one of its pre-defined components' templates, and streams the result back\nto the user's browser.\n\n## Examples\n\n- [TODO list](./examples/todo%20application/): a simple todo list application, illustrating how to create a basic CRUD application with SQLPage.\n- [Plots, Tables, forms, and interactivity](./examples/plots%20tables%20and%20forms/): a short well-commented demo showing how to use plots, tables, forms, and interactivity to filter data based on an URL parameter.\n- [Tiny splitwise clone](./examples/splitwise): a shared expense tracker app\n- [Corporate Conundrum](./examples/corporate-conundrum/): a board game implemented in SQL\n- [Master-Detail Forms](./examples/master-detail-forms/): shows how to implement a simple set of forms to insert data into database tables that have a one-to-many relationship.\n- [SQLPage's own official website and documentation](./examples/official-site/): The SQL source code for the project's official site, https://sql-page.com\n- [Image gallery](./examples/image%20gallery%20with%20user%20uploads/): An image gallery where users can log in and upload images. Illustrates the implementation of a user authentication system using session cookies, and the handling of file uploads.\n- [User Management](./examples/user-authentication/): An authentication demo with user registration, log in, log out, and confidential pages. Uses PostgreSQL.\n- [Making a JSON API and integrating React components in the frontend](./examples/using%20react%20and%20other%20custom%20scripts%20and%20styles/): Shows how to integrate a react component in a SQLPage website, and how to easily build a REST API with SQLPage.\n- [Handling file uploads](./examples/image%20gallery%20with%20user%20uploads): An image gallery where authenticated users can publish new images via an upload form.\n- [Bulk data import from CSV files](./examples/official-site/examples/handle_csv_upload.sql) : A simple form letting users import CSV files to fill a database table.\n- [Advanced authentication example using PostgreSQL stored procedures](https://github.com/mnesarco/sqlpage_auth_example)\n- [Complex web application in SQLite with user management, file uploads, plots, maps, tables, menus, ...](https://github.com/DSMejantel/Ecole_inclusive)\n- [Single sign-on](./examples/single%20sign%20on): An example of how to implement OAuth and OpenID Connect (OIDC) authentication in SQLPage. The demo also includes a CAS (Central Authentication Service) client.\n- [Dark theme](./examples/light-dark-toggle/) : demonstrates how to let the user toggle between a light theme and a dark theme, and store the user's preference.\n\nYou can try all the examples online without installing anything on your computer using [SQLPage's online demo on replit](https://replit.com/@pimaj62145/SQLPage).\n\n## Configuration\n\nSQLPage can be configured through either a configuration file placed in `sqlpage/sqlpage.json`\nor environment variables such as `DATABASE_URL` or `LISTEN_ON`.\n\nFor more information, read [`configuration.md`](./configuration.md).\n\nAdditionally, custom components can be created by placing [`.handlebars`](https://handlebarsjs.com/guide/)\nfiles in `sqlpage/templates`. [Example](./sqlpage/templates/card.handlebars).\n\n### HTTPS\n\nSQLPage supports HTTP/2 and HTTPS natively and transparently.\nJust set `SQLPAGE_HTTPS_DOMAIN=example.com`, and SQLPage\nwill automatically request a trusted certificate and\nstart encrypting all your user's traffic with it.\nNo tedious manual configuration for you,\nand no annoying \"Connection is Not Secure\" messages for your users !\n\n## Serverless\n\nYou can run SQLpage [serverless](https://en.wikipedia.org/wiki/Serverless_computing)\nby compiling it to an [AWS Lambda function](https://aws.amazon.com/lambda/).\nAn easy way to do so is using the provided docker image:\n\n```bash\n docker build -t sqlpage-lambda-builder . -f lambda.Dockerfile --target builder\n docker run sqlpage-lambda-builder cat deploy.zip \u003e sqlpage-aws-lambda.zip\n```\n\nYou can then just add your own SQL files to `sqlpage-aws-lambda.zip`,\nand [upload it to AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip),\nselecting *Custom runtime on Amazon Linux 2* as a runtime.\n\n### Hosting sql files directly inside the database\n\nWhen running serverless, you can include the SQL files directly in the image that you are deploying.\nBut if you want to be able to update your sql files on the fly without creating a new image,\nyou can store the files directly inside the database, in a table that has the following structure: \n\n```sql\nCREATE TABLE sqlpage_files(\n  path VARCHAR(255) NOT NULL PRIMARY KEY,\n  contents BLOB,\n  last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```\n\nMake sure to update `last_modified` every time you update the contents of a file (or do it inside a TRIGGER).\nSQLPage will re-parse a file from the database only when it has been modified.\n\n## Technologies and libraries used\n\n- [actix web](https://actix.rs/) handles HTTP requests at an incredible speed,\n- [tabler](https://preview.tabler.io) handles the styling for professional-looking clean components,\n- [tabler icons](https://tabler-icons.io) is a large set of icons you can select directly from your SQL,\n- [handlebars](https://handlebarsjs.com/guide/) render HTML pages from readable templates for each component.\n\n## Frequently Asked Questions\n\n\u003e **Why use SQL instead of a real programming language? SQL isn't even [Turing-complete](https://en.wikipedia.org/wiki/Turing_completeness)!**\n\n- You're focusing on the wrong issue. If you can express your application declaratively, you should—whether using SQL or another language. Declarative code is often more concise, readable, easier to reason about, and easier to debug than imperative code.\n- SQL is simpler than traditional languages, often readable by non-programmers, yet very powerful.\n- If complexity is your goal, note that [SQL is actually Turing-complete](https://stackoverflow.com/questions/900055/is-sql-or-even-tsql-turing-complete/7580013#7580013).\n- Even without recursive queries, a sequence of SQL statements driven by user interactions (like SQLPage) would still be Turing-complete, enabling you to build a SQL-powered website that functions as a Turing machine.\n\n\u003e **Just Because You Can Doesn’t Mean You Should...**  \n— [someone being mean on Reddit](https://www.reddit.com/r/rust/comments/14qjskz/comment/jr506nx)\n\nIt's not about \"should\" — it's about \"why not?\"\nKeep coloring inside the lines if you want, but we'll be over here having fun with our SQL websites.\n\n\u003e **Is this the same as Microsoft Access?**\n\nThe goals are similar — creating simple data-centric applications — but the tools differ significantly:\n- SQLPage is a web server, not a desktop app.\n- SQLPage connects to existing robust relational databases; Access tries to **be** a database.\n- Access is expensive and proprietary; SQLPage is [open-source](./LICENSE.txt).\n- SQLPage spares you from the torment of [Visual Basic for Applications](https://en.wikipedia.org/wiki/Visual_Basic_for_Applications).\n\n\u003e **Is the name a reference to Microsoft FrontPage?**\n\nFrontPage was a visual static website builder popular in the late '90s. I hadn't heard of it until someone asked.\n\n\u003e **I like CSS. I want to design websites, not write SQL.**\n\nIf you want to write your own HTML and CSS,\nyou can [create custom components](https://sql-page.com/custom_components.sql)\nby adding a [`.handlebars`](https://handlebarsjs.com/guide/) file in `sqlpage/templates` and writing your HTML and CSS there. ([Example](./sqlpage/templates/alert.handlebars)).\nYou can also use the `html` component to write raw HTML, or the `shell` component to include custom scripts and styles.\n\nBut SQLPage believes you shouldn't worry about button border radii until you have a working prototype.\nWe provide good-looking components out of the box so you can focus on your data model, and iterate quickly.\n\n## Download\n\nSQLPage is available for download on the from multiple sources:\n\n[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/sqlpage/SQLPage/total?label=direct%20download)](https://github.com/sqlpage/SQLPage/releases/latest)\n[![Docker Pulls](https://img.shields.io/docker/pulls/sqlpage/SQLPage?label=docker%3A%20lovasoa%2Fsqlpage)](https://hub.docker.com/r/sqlpage/SQLPage)\n[![homebrew downloads](https://img.shields.io/homebrew/installs/dq/sqlpage?label=homebrew%20downloads\u0026labelColor=%232e2a24\u0026color=%23f9d094)](https://formulae.brew.sh/formula/sqlpage#default)\n[![Scoop Version](https://img.shields.io/scoop/v/sqlpage?labelColor=%23696573\u0026color=%23d7d4db)](https://scoop.sh/#/apps?q=sqlpage\u0026id=305b3437817cd197058954a2f76ac1cf0e444116)\n[![Crates.io Total Downloads](https://img.shields.io/crates/d/sqlpage?label=crates.io%20download\u0026labelColor=%23264323\u0026color=%23f9f7ec)](https://crates.io/crates/sqlpage)\n[![](https://img.shields.io/badge/Nix-pkg-rgb(126,%20185,%20227))](https://search.nixos.org/packages?channel=unstable\u0026show=sqlpage\u0026from=0\u0026size=50\u0026sort=relevance\u0026type=packages\u0026query=sqlpage)\n\n## Contributing\n\nWe welcome contributions! SQLPage is built with Rust and uses\nvanilla javascript for its frontend parts.\n\nCheck out our [Contributing Guide](./CONTRIBUTING.md) for detailed instructions on development setup, testing, and pull request process.\n\n# Code signing policy\n\nOur windows binaries are digitally signed, so they should be recognized as safe by Windows.\nFree code signing provided by [SignPath.io](https://about.signpath.io/), certificate by [SignPath Foundation](https://signpath.org/). [Contributors](https://github.com/sqlpage/SQLPage/graphs/contributors), [Owners](https://github.com/orgs/sqlpage/people?query=role%3Aowner).\n\nThis program will not transfer any information to other networked systems unless specifically requested by the user or the person installing or operating it\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlpage%2Fsqlpage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqlpage%2Fsqlpage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlpage%2Fsqlpage/lists"}