-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Description
Hi, I'm connecting to a remote PostgreSQL database using the following sqlpage.json file. Actual parameters are omitted but it connects normally:
{
"database_url": "postgres://<user>:<password>:<port>/<dbname>",
"listen_on": "127.0.0.1:9001"
}
This is the index.json file:
SELECT 'hero' AS component,
'Testing SQLPage' AS title,
'connected to PostgreSQL' AS description_md;
SELECT 'list' AS component,
'Users' AS title;
select a.name as title from assets a;
When launching sqlpage.exe from a command window it reports some warnings that seem to be related to the default "it works" page:
[2023-11-16T13:27:35Z INFO sqlpage::webserver::database::connect] Connecting to database: postgres://<my_database>
[2023-11-16T13:27:35Z WARN sqlpage::webserver::database::sql] Failed to prepare "SELECT 'hero' AS component, 'It works !' AS title, 'If you can see this, then SQLPage v' || CAST($1 AS TEXT) || ' is running correctly on your server. Congratulations! ' AS description": Failed to prepare SQL statement:
SELECT 'hero' AS component, 'It works !' AS title, 'If you can see this, then SQLPage v' || CAST($1 AS TEXT) || ' is running correctly on your server. Congratulations! ' AS description: error returned from database: prepared statement "sqlx_s_1" already exists: prepared statement "sqlx_s_1" already exists
[2023-11-16T13:27:35Z WARN sqlpage::webserver::database::sql] Failed to prepare "SELECT CAST($1 AS TEXT) AS contents, 1 AS code": Failed to prepare SQL statement:
SELECT CAST($1 AS TEXT) AS contents, 1 AS code: error returned from database: prepared statement "sqlx_s_2" already exists: prepared statement "sqlx_s_2" already exists
[2023-11-16T13:27:35Z WARN sqlpage::webserver::database::sql] Failed to prepare "SELECT 'You can customize your server''s [configuration](https://github.com/lovasoa/SQLpage/blob/main/configuration.md)\r\nby creating a file in `' || CAST($1 AS TEXT) || '/sqlpage/sqlpage.json`.' AS contents_md": Failed to prepare SQL statement:
SELECT 'You can customize your server''s [configuration](https://github.com/lovasoa/SQLpage/blob/main/configuration.md): error returned from database: prepared statement "sqlx_s_2" already exists: prepared statement "sqlx_s_2" already exists
[2023-11-16T13:27:35Z INFO sqlpage::webserver::database::migrations] Applying migrations from 'C:\Users\...\sqlpage/migrations'
[2023-11-16T13:27:35Z INFO sqlpage::webserver::database::migrations] No migration found. You can specify database operations to apply when the server first starts by creating files in sqlpage/migrations/<VERSION>_<DESCRIPTION>.sql where <VERSION> is a number and <DESCRIPTION> is a short string.
[2023-11-16T13:27:35Z INFO sqlpage] Starting server on 127.0.0.1:9001
[2023-11-16T13:27:35Z INFO actix_server::builder] starting 8 workers
[2023-11-16T13:27:35Z INFO actix_server::server] Actix runtime found; starting in Actix runtime
[2023-11-16T13:27:35Z INFO sqlpage] Server started successfully.
SQLPage is now running on http://127.0.0.1:9001/
You can write your website's code in .sql files in C:\Users\...\sqlpage-windows.
When I open the page (using Chrome) I see this error:
Error in query number 1:
Failed to execute SQL statement:
SELECT a.name AS title FROM assets AS a
Backtrace
error returned from database: prepared statement "sqlx_s_3" already exists
prepared statement "sqlx_s_3" already exists
What am I doing wrong?
Metadata
Metadata
Assignees
Labels
No labels