Replies: 24 comments 63 replies
-
How to Use SQLPage with your PostgreSQL DatabaseHi David, and welcome to SQLPage ! You've already successfully set up SQLPage and verified that it's running on your local machine, congratulations ! To connect SQLPage to your PostgreSQL database and run SQL queries, you can follow the instructions from the official get started guide, in the section Connect to a custom database. Connecting SQLPage to PostgreSQL
Running SQL QueriesNow, let's see how to run SQL queries using SQLPage.
Additional ExamplesMost examples in the examples directory use the SQLite SQL dialect. They may need some minor syntax adaptations to run on PostgreSQL. One exception is the user authentication example, which is written using PostgreSQL syntax and database features. |
Beta Was this translation helpful? Give feedback.
-
Oh, okay. Anyway, I think I'll be all set now.
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
…On Mon, Sep 4, 2023 at 5:50 AM Ophir LOJKINE ***@***.***> wrote:
"Now, you can either restore the old version of your sql migration file if
you still have it, or delete it completely."
That sounds like you're saying that I can drop the users table, perhaps
'archive' off the old migration file to a storage area somewhere, and then
create a new users table using a new migration file. Yes?
No, I was talking about the migration *file*. But now that you found the
sqlx_migrations table, the best thing to do to start from a clean state
is to remove the sqlx_migrations so that sqlpage does not remembder it
has applied the migration, and write whatever migration you want.
—
Reply to this email directly, view it on GitHub
<#73 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMYVMGKFE767F3W6KV4YGTXYWP4RANCNFSM6AAAAAA4AGKXKM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hey Ophir,
Howdy, it's me, David, again! I don't have any silly questions this time.
Or even any pressing issues, really. Just looking for some "direction", is
all.
I've spent the time since we last communicated, building up my database
application. It's now done and tested on my client-side. So, I now have a
database server and database (in PostgreSQL 15) and of course my app
written in PL/pgSQL, that I want to launch on smart phone platforms,
targeting the IoT. What I am looking for (need) is ...
Where do I find (read up on) in the documentation, on how to set these up
on SQLPage in order to get started? Please point me - in the docs - to
where I get this process underway. Make sense? Thank you, Buddy,
David
P.S. I'll be poking around on my own, but it's just that I often find
myself going around in circles when I don't have a specific roadmap of
where and "how" to proceed. (:>)
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 4, 2023 at 6:04 AM David Bailey ***@***.***>
wrote:
… Oh, okay. Anyway, I think I'll be all set now.
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 4, 2023 at 5:50 AM Ophir LOJKINE ***@***.***>
wrote:
> "Now, you can either restore the old version of your sql migration file
> if you still have it, or delete it completely."
>
> That sounds like you're saying that I can drop the users table, perhaps
> 'archive' off the old migration file to a storage area somewhere, and then
> create a new users table using a new migration file. Yes?
>
> No, I was talking about the migration *file*. But now that you found the
> sqlx_migrations table, the best thing to do to start from a clean state
> is to remove the sqlx_migrations so that sqlpage does not remembder it
> has applied the migration, and write whatever migration you want.
>
> —
> Reply to this email directly, view it on GitHub
> <#73 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADMYVMGKFE767F3W6KV4YGTXYWP4RANCNFSM6AAAAAA4AGKXKM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
Oh, okay. I'll start with the "Getting Started" guide link (
https://sql.ophir.dev/your-first-sql-website/ ) and go from there. And,
yes, I'll circle back if I need more specific information. Thanks Ophir,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
…On Sun, Sep 24, 2023 at 2:02 PM Ophir LOJKINE ***@***.***> wrote:
Hi David!
I'm not entirely sure what you are looking for. The "getting started"
guide is linked from SQLPage's homepage :
https://sql.ophir.dev/your-first-sql-website/
If you need guidance on a specific topic that isn't covered on the
official website yet, or hit something that isn't clear, ask here and I'll
update the website.
—
Reply to this email directly, view it on GitHub
<#73 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMYVMHSBBQFF7CXLUIMXFLX4BYTNANCNFSM6AAAAAA4AGKXKM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hey Ophir,
I encountered a bunch of issues on my way to getting migrations fired up.
Fortunately I saved all of my notes from our earlier conversations, and got
them all resolved without having to bug you again. (:>)
Here's a new error that I couldn't find anywhere, though:
"2023-09-25T12:34:38Z ERROR sqlpage] Unable to listen to the specified port
Caused by:
An attempt was made to access a socket in a way forbidden by its
access permissions. (os error 10013)"
Why is this error showing up? The configuration seems to be okay. Anyway,
can you direct me to where I can find information on how to resolve it?
Thanks, Buddy,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Sun, Sep 24, 2023 at 2:49 PM David Bailey ***@***.***>
wrote:
… Oh, okay. I'll start with the "Getting Started" guide link (
https://sql.ophir.dev/your-first-sql-website/ ) and go from there. And,
yes, I'll circle back if I need more specific information. Thanks Ophir,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Sun, Sep 24, 2023 at 2:02 PM Ophir LOJKINE ***@***.***>
wrote:
> Hi David!
> I'm not entirely sure what you are looking for. The "getting started"
> guide is linked from SQLPage's homepage :
> https://sql.ophir.dev/your-first-sql-website/
> If you need guidance on a specific topic that isn't covered on the
> official website yet, or hit something that isn't clear, ask here and I'll
> update the website.
>
> —
> Reply to this email directly, view it on GitHub
> <#73 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADMYVMHSBBQFF7CXLUIMXFLX4BYTNANCNFSM6AAAAAA4AGKXKM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
Uh, never mind, I restarted my desktop and reloaded the server via
sqlpage.exe and the port listening error went away. I'm now able to see a
pag when I fire up http:\localhost:8080 ...
"Popular Websites
Hello
world!
<https://wilipedia.org/>
"
Um, why this page? Where is the SQL that is generating it?
Cheers,
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 8:57 AM David Bailey ***@***.***>
wrote:
… Hey Ophir,
I encountered a bunch of issues on my way to getting migrations fired up.
Fortunately I saved all of my notes from our earlier conversations, and got
them all resolved without having to bug you again. (:>)
Here's a new error that I couldn't find anywhere, though:
"2023-09-25T12:34:38Z ERROR sqlpage] Unable to listen to the specified port
Caused by:
An attempt was made to access a socket in a way forbidden by its
access permissions. (os error 10013)"
Why is this error showing up? The configuration seems to be okay.
Anyway, can you direct me to where I can find information on how to resolve
it? Thanks, Buddy,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Sun, Sep 24, 2023 at 2:49 PM David Bailey <
***@***.***> wrote:
> Oh, okay. I'll start with the "Getting Started" guide link (
> https://sql.ophir.dev/your-first-sql-website/ ) and go from there. And,
> yes, I'll circle back if I need more specific information. Thanks Ophir,
>
> David
>
> -:-
>
> David Bailey
> ***@***.***
>
> 207 691 4123 Cell
> 509 267 7789 Fax
>
> "Any sufficiently advanced technology is indistinguishable from magic."
> Arthur C. Clarke
>
>
> On Sun, Sep 24, 2023 at 2:02 PM Ophir LOJKINE ***@***.***>
> wrote:
>
>> Hi David!
>> I'm not entirely sure what you are looking for. The "getting started"
>> guide is linked from SQLPage's homepage :
>> https://sql.ophir.dev/your-first-sql-website/
>> If you need guidance on a specific topic that isn't covered on the
>> official website yet, or hit something that isn't clear, ask here and I'll
>> update the website.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#73 (reply in thread)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ADMYVMHSBBQFF7CXLUIMXFLX4BYTNANCNFSM6AAAAAA4AGKXKM>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
Beta Was this translation helpful? Give feedback.
-
Popular Websites
Hello
world!
<https://wilipedia.org/>
Hey, upon browsing to http:\\localhost:8080, I get this "Popular Websites"
page. I thought I was going to get the Success page
that I got originally, not this one. So I guess I am still not
understanding where the example code goes in order for it to show up
on the web page. I don't have any index.sql active. There is only one
migration file for create user. And there is nothing in
the sqlpage\templates folder either.
So, my question is where does the code live that generated this Popular
Websites page come from? I thought I wrote this down
before, but I guess I didn't. Rats!
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 9:22 AM David Bailey ***@***.***>
wrote:
… Uh, never mind, I restarted my desktop and reloaded the server via
sqlpage.exe and the port listening error went away. I'm now able to see a
pag when I fire up http:\localhost:8080 ...
"Popular Websites
Hello
world!
<https://wilipedia.org/>
"
Um, why this page? Where is the SQL that is generating it?
Cheers,
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 8:57 AM David Bailey <
***@***.***> wrote:
> Hey Ophir,
>
> I encountered a bunch of issues on my way to getting migrations fired
> up. Fortunately I saved all of my notes from our earlier conversations,
> and got them all resolved without having to bug you again. (:>)
>
> Here's a new error that I couldn't find anywhere, though:
>
> "2023-09-25T12:34:38Z ERROR sqlpage] Unable to listen to the specified
> port
>
> Caused by:
> An attempt was made to access a socket in a way forbidden by its
> access permissions. (os error 10013)"
>
> Why is this error showing up? The configuration seems to be okay.
> Anyway, can you direct me to where I can find information on how to resolve
> it? Thanks, Buddy,
>
> David
>
> -:-
>
> David Bailey
> ***@***.***
>
> 207 691 4123 Cell
> 509 267 7789 Fax
>
> "Any sufficiently advanced technology is indistinguishable from magic."
> Arthur C. Clarke
>
>
> On Sun, Sep 24, 2023 at 2:49 PM David Bailey <
> ***@***.***> wrote:
>
>> Oh, okay. I'll start with the "Getting Started" guide link (
>> https://sql.ophir.dev/your-first-sql-website/ ) and go from there.
>> And, yes, I'll circle back if I need more specific information. Thanks
>> Ophir,
>>
>> David
>>
>> -:-
>>
>> David Bailey
>> ***@***.***
>>
>> 207 691 4123 Cell
>> 509 267 7789 Fax
>>
>> "Any sufficiently advanced technology is indistinguishable from magic."
>> Arthur C. Clarke
>>
>>
>> On Sun, Sep 24, 2023 at 2:02 PM Ophir LOJKINE ***@***.***>
>> wrote:
>>
>>> Hi David!
>>> I'm not entirely sure what you are looking for. The "getting started"
>>> guide is linked from SQLPage's homepage :
>>> https://sql.ophir.dev/your-first-sql-website/
>>> If you need guidance on a specific topic that isn't covered on the
>>> official website yet, or hit something that isn't clear, ask here and I'll
>>> update the website.
>>>
>>> —
>>> Reply to this email directly, view it on GitHub
>>> <#73 (reply in thread)>,
>>> or unsubscribe
>>> <https://github.com/notifications/unsubscribe-auth/ADMYVMHSBBQFF7CXLUIMXFLX4BYTNANCNFSM6AAAAAA4AGKXKM>
>>> .
>>> You are receiving this because you authored the thread.Message ID:
>>> ***@***.***>
>>>
>>
|
Beta Was this translation helpful? Give feedback.
-
If you find migrations difficult, you don't have to use them. They are very useful for larger projects, but if it's just you messing around, you'll be just as fine changing your database schema directly on your postgres instance through pgAdmin.
This is windows telling you not to launch two instances of sqlpage with the same configuration at the same time. If you have an instance running, it is already waiting for client connections on port 8080 (by default), so if you try to launch a second instance, it will fail. |
Beta Was this translation helpful? Give feedback.
-
Yes you have 🙂 The example code is not included with sqlpage, so if you see it, it comes from a file you wrote yourself. If you are using the latest version of sqlpage, look at the console, it will tell you where it is serving files from. |
Beta Was this translation helpful? Give feedback.
-
Well, I restarted everything and the "It works!" page displayed. I'm not
sure how the Popular Websites code was "served"
before, instead. Anyway, is the code for the "It works !" page in one of
the Examples folders? If so, what is it called?
You said "If you are using the latest version of sqlpage, look at the
console, it will tell you where it is serving files from"
1. How can I tell what version of SQLPage I am running? The sqlpage.exe
file I first downloaded is dated 8/25/2023.
2. Does the console output of "2023-09-25T17:30:45Z INFO
sqlpage::webserver::database] Connecting to database:
***@***.***:5432/mypgdb" mean that
SQLPage.exe is serving from my PostgreSQL 15
mypgdb database?
3. If I want to run a different "example", does that just mean that I need
to put .sql files, one of which will be an index.sql file,
from the GitHub Examples in the root folder, yes?
Geesh! I thought sure I was over asking you silly questions, but ...
there I go again ... THINKING! (:>)
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
…On Mon, Sep 25, 2023 at 1:40 PM Ophir LOJKINE ***@***.***> wrote:
So I guess I am still not understanding where the example code goes in
order for it to show upon the web page. I don't have any index.sql active.
Yes you have 🙂 The example code is not included with sqlpage, so if you
see it, it comes from a file you wrote yourself. If you are using the
latest version of sqlpage, look at the console, it will tell you where it
is serving files from.
—
Reply to this email directly, view it on GitHub
<#73 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMYVMHBZDGTZGRPUGUDPL3X4G6ZRANCNFSM6AAAAAA4AGKXKM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Where is(are) the "It works !" page's file(s)?
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 4:11 PM David Bailey ***@***.***>
wrote:
… Well, I restarted everything and the "It works!" page displayed. I'm not
sure how the Popular Websites code was "served"
before, instead. Anyway, is the code for the "It works !" page in one of
the Examples folders? If so, what is it called?
You said "If you are using the latest version of sqlpage, look at the
console, it will tell you where it is serving files from"
1. How can I tell what version of SQLPage I am running? The sqlpage.exe
file I first downloaded is dated 8/25/2023.
2. Does the console output of "2023-09-25T17:30:45Z INFO
sqlpage::webserver::database] Connecting to database:
***@***.***:5432/mypgdb" mean that
SQLPage.exe is serving from my PostgreSQL 15
mypgdb database?
3. If I want to run a different "example", does that just mean that I
need to put .sql files, one of which will be an index.sql file,
from the GitHub Examples in the root folder, yes?
Geesh! I thought sure I was over asking you silly questions, but ...
there I go again ... THINKING! (:>)
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 1:40 PM Ophir LOJKINE ***@***.***>
wrote:
> So I guess I am still not understanding where the example code goes in
> order for it to show upon the web page. I don't have any index.sql
> active.
>
> Yes you have 🙂 The example code is not included with sqlpage, so if you
> see it, it comes from a file you wrote yourself. If you are using the
> latest version of sqlpage, look at the console, it will tell you where it
> is serving files from.
>
> —
> Reply to this email directly, view it on GitHub
> <#73 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADMYVMHBZDGTZGRPUGUDPL3X4G6ZRANCNFSM6AAAAAA4AGKXKM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
Hey Ophir,
I was feeling really dumb, not being able to find the "It works !" page's
code! But now I know what I couldn't. Anyway, my questions seem less
silly and more 'legitimate', now. Oh, the footer hover shows that I have
"SQLPage v0.10.0"(By the way, can I run the sqlpage.version function from
inside of PGAdmin4, or do I have to do it in an index.sql file from the
root folder?). What is the current/latest version, anyway? Any hooo,
thanks for the thoughtful answers/replies!
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
…On Mon, Sep 25, 2023 at 5:25 PM Ophir LOJKINE ***@***.***> wrote:
The code is embedded in the sqlpage binary so that everything is
self-contained. The source is here:
https://github.com/lovasoa/SQLpage/blob/main/index.sql
—
Reply to this email directly, view it on GitHub
<#73 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMYVMA4ZN4GHWE5YPJUU7DX4HZEXANCNFSM6AAAAAA4AGKXKM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Dear Ophir,
Kewl. Your answers/replies are always so helpful and insightful! The more
I get of them, the more I understand all things "SQLPage-age!" (:>)
Thank you again, my man! Cheers,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
…On Mon, Sep 25, 2023 at 6:25 PM Ophir LOJKINE ***@***.***> wrote:
You can follow releases here: https://github.com/lovasoa/SQLpage/releases
. This will always give you the latest version. You should upgrade now.
You can watch this repository to be notified of updates, too.
By the way, can I run the sqlpage.version function from inside of
PGAdmin4, or do I have to do it in an index.sql file from the root folder?
PgAdmin lets you interact with the database directly, there is no way it
could tell you anything about sqlpage. Functions available in sqlpage are
not run on the database, but inside sqlpage, and their result is sent to
the database before executing the queries. They are not visible to the
database.
—
Reply to this email directly, view it on GitHub
<#73 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMYVMC2PZLNCDNSXXPF3LTX4IAEHANCNFSM6AAAAAA4AGKXKM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hmmm, should I update to the Version 0.11.1 Security update release, or the
Version 0.12.0-Beta release?
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 11:40 PM David Bailey ***@***.***>
wrote:
… Dear Ophir,
Kewl. Your answers/replies are always so helpful and insightful! The
more I get of them, the more I understand all things "SQLPage-age!" (:>)
Thank you again, my man! Cheers,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 6:25 PM Ophir LOJKINE ***@***.***>
wrote:
> You can follow releases here: https://github.com/lovasoa/SQLpage/releases
> . This will always give you the latest version. You should upgrade now.
> You can watch this repository to be notified of updates, too.
>
> By the way, can I run the sqlpage.version function from inside of
> PGAdmin4, or do I have to do it in an index.sql file from the root folder?
>
> PgAdmin lets you interact with the database directly, there is no way it
> could tell you anything about sqlpage. Functions available in sqlpage are
> not run on the database, but inside sqlpage, and their result is sent to
> the database before executing the queries. They are not visible to the
> database.
>
> —
> Reply to this email directly, view it on GitHub
> <#73 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADMYVMC2PZLNCDNSXXPF3LTX4IAEHANCNFSM6AAAAAA4AGKXKM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
Um, I decided to go with v0.11.1. (:>) Is there a SQL CREATE script for
the sqlpage_files table, so I get the column's data types right?
It works !
If you can see this, then SQLPage v0.11.1 is running correctly on your
server. Congratulations!
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 11:45 PM David Bailey ***@***.***>
wrote:
… Hmmm, should I update to the Version 0.11.1 Security update release, or
the Version 0.12.0-Beta release?
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 11:40 PM David Bailey <
***@***.***> wrote:
> Dear Ophir,
>
> Kewl. Your answers/replies are always so helpful and insightful! The
> more I get of them, the more I understand all things "SQLPage-age!" (:>)
>
> Thank you again, my man! Cheers,
>
> David
> -:-
>
> David Bailey
> ***@***.***
>
> 207 691 4123 Cell
> 509 267 7789 Fax
>
> "Any sufficiently advanced technology is indistinguishable from magic."
> Arthur C. Clarke
>
>
> On Mon, Sep 25, 2023 at 6:25 PM Ophir LOJKINE ***@***.***>
> wrote:
>
>> You can follow releases here:
>> https://github.com/lovasoa/SQLpage/releases . This will always give you
>> the latest version. You should upgrade now.
>> You can watch this repository to be notified of updates, too.
>>
>> By the way, can I run the sqlpage.version function from inside of
>> PGAdmin4, or do I have to do it in an index.sql file from the root folder?
>>
>> PgAdmin lets you interact with the database directly, there is no way it
>> could tell you anything about sqlpage. Functions available in sqlpage are
>> not run on the database, but inside sqlpage, and their result is sent to
>> the database before executing the queries. They are not visible to the
>> database.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#73 (reply in thread)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ADMYVMC2PZLNCDNSXXPF3LTX4IAEHANCNFSM6AAAAAA4AGKXKM>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
Beta Was this translation helpful? Give feedback.
-
Got it ...
CREATE TABLE sqlpage_files(
INSERT INTO sqlpage_files(path, contents) VALUES ('unit test file.txt',
'Héllö world! 😀');
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Tue, Sep 26, 2023 at 12:18 AM David Bailey ***@***.***>
wrote:
… Um, I decided to go with v0.11.1. (:>) Is there a SQL CREATE script
for the sqlpage_files table, so I get the column's data types right?
It works !
If you can see this, then SQLPage v0.11.1 is running correctly on your
server. Congratulations!
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Mon, Sep 25, 2023 at 11:45 PM David Bailey <
***@***.***> wrote:
> Hmmm, should I update to the Version 0.11.1 Security update release, or
> the Version 0.12.0-Beta release?
>
> -:-
>
> David Bailey
> ***@***.***
>
> 207 691 4123 Cell
> 509 267 7789 Fax
>
> "Any sufficiently advanced technology is indistinguishable from magic."
> Arthur C. Clarke
>
>
> On Mon, Sep 25, 2023 at 11:40 PM David Bailey <
> ***@***.***> wrote:
>
>> Dear Ophir,
>>
>> Kewl. Your answers/replies are always so helpful and insightful! The
>> more I get of them, the more I understand all things "SQLPage-age!" (:>)
>>
>> Thank you again, my man! Cheers,
>>
>> David
>> -:-
>>
>> David Bailey
>> ***@***.***
>>
>> 207 691 4123 Cell
>> 509 267 7789 Fax
>>
>> "Any sufficiently advanced technology is indistinguishable from magic."
>> Arthur C. Clarke
>>
>>
>> On Mon, Sep 25, 2023 at 6:25 PM Ophir LOJKINE ***@***.***>
>> wrote:
>>
>>> You can follow releases here:
>>> https://github.com/lovasoa/SQLpage/releases . This will always give
>>> you the latest version. You should upgrade now.
>>> You can watch this repository to be notified of updates, too.
>>>
>>> By the way, can I run the sqlpage.version function from inside of
>>> PGAdmin4, or do I have to do it in an index.sql file from the root folder?
>>>
>>> PgAdmin lets you interact with the database directly, there is no way
>>> it could tell you anything about sqlpage. Functions available in sqlpage
>>> are not run on the database, but inside sqlpage, and their result is sent
>>> to the database before executing the queries. They are not visible to the
>>> database.
>>>
>>> —
>>> Reply to this email directly, view it on GitHub
>>> <#73 (reply in thread)>,
>>> or unsubscribe
>>> <https://github.com/notifications/unsubscribe-auth/ADMYVMC2PZLNCDNSXXPF3LTX4IAEHANCNFSM6AAAAAA4AGKXKM>
>>> .
>>> You are receiving this because you authored the thread.Message ID:
>>> ***@***.***>
>>>
>>
|
Beta Was this translation helpful? Give feedback.
-
I'm off to the races!
…--SQLPage Test Query (sqlpagetestguery.sql) ...
SELECT 'text' AS component;
SELECT 'Current SQLPage Version is ''v' AS contents;
SELECT sqlpage.version() AS contents, true AS code;
SELECT '''' AS contents;
--INSERT INTO public.test ( tst_id, tst_text) VALUES (1, 'Current SQLPage
Version is ''v');
--UPDATE public.test SET tst_text = tst_text || sqlpage.version() WHERE
tst_id = 1;
--UPDATE public.test SET tst_text = tst_text || '''' WHERE tst_id = 1);
SELECT 'text' AS component;
SELECT 'Currently running from directory ''' AS contents;
SELECT sqlpage.current_working_directory() AS contents, true AS code;
SELECT '''' AS contents;
--INSERT INTO test (tst_id, tst_text) VALUES (2, sqlpage.version())
RETURNING 'integer-value' AS value, 'string-value' AS value;
SELECT 'table' AS component;
SELECT * FROM test;
[image: image.png]
Thanks again! Cheers,
David
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Tue, Sep 26, 2023 at 12:22 AM David Bailey ***@***.***>
wrote:
Got it ...
CREATE TABLE sqlpage_files(
INSERT INTO sqlpage_files(path, contents) VALUES ('unit test file.txt',
'Héllö world! 😀');
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Tue, Sep 26, 2023 at 12:18 AM David Bailey <
***@***.***> wrote:
> Um, I decided to go with v0.11.1. (:>) Is there a SQL CREATE script
> for the sqlpage_files table, so I get the column's data types right?
> It works !
> If you can see this, then SQLPage v0.11.1 is running correctly on your
> server. Congratulations!
>
>
> -:-
>
> David Bailey
> ***@***.***
>
> 207 691 4123 Cell
> 509 267 7789 Fax
>
> "Any sufficiently advanced technology is indistinguishable from magic."
> Arthur C. Clarke
>
>
> On Mon, Sep 25, 2023 at 11:45 PM David Bailey <
> ***@***.***> wrote:
>
>> Hmmm, should I update to the Version 0.11.1 Security update release, or
>> the Version 0.12.0-Beta release?
>>
>> -:-
>>
>> David Bailey
>> ***@***.***
>>
>> 207 691 4123 Cell
>> 509 267 7789 Fax
>>
>> "Any sufficiently advanced technology is indistinguishable from magic."
>> Arthur C. Clarke
>>
>>
>> On Mon, Sep 25, 2023 at 11:40 PM David Bailey <
>> ***@***.***> wrote:
>>
>>> Dear Ophir,
>>>
>>> Kewl. Your answers/replies are always so helpful and insightful! The
>>> more I get of them, the more I understand all things "SQLPage-age!" (:>)
>>>
>>> Thank you again, my man! Cheers,
>>>
>>> David
>>> -:-
>>>
>>> David Bailey
>>> ***@***.***
>>>
>>> 207 691 4123 Cell
>>> 509 267 7789 Fax
>>>
>>> "Any sufficiently advanced technology is indistinguishable from magic."
>>> Arthur C. Clarke
>>>
>>>
>>> On Mon, Sep 25, 2023 at 6:25 PM Ophir LOJKINE ***@***.***>
>>> wrote:
>>>
>>>> You can follow releases here:
>>>> https://github.com/lovasoa/SQLpage/releases . This will always give
>>>> you the latest version. You should upgrade now.
>>>> You can watch this repository to be notified of updates, too.
>>>>
>>>> By the way, can I run the sqlpage.version function from inside of
>>>> PGAdmin4, or do I have to do it in an index.sql file from the root folder?
>>>>
>>>> PgAdmin lets you interact with the database directly, there is no way
>>>> it could tell you anything about sqlpage. Functions available in sqlpage
>>>> are not run on the database, but inside sqlpage, and their result is sent
>>>> to the database before executing the queries. They are not visible to the
>>>> database.
>>>>
>>>> —
>>>> Reply to this email directly, view it on GitHub
>>>> <#73 (reply in thread)>,
>>>> or unsubscribe
>>>> <https://github.com/notifications/unsubscribe-auth/ADMYVMC2PZLNCDNSXXPF3LTX4IAEHANCNFSM6AAAAAA4AGKXKM>
>>>> .
>>>> You are receiving this because you authored the thread.Message ID:
>>>> ***@***.***>
>>>>
>>>
|
Beta Was this translation helpful? Give feedback.
-
Hey,
I'm trying to use the new set variable feature in the v0.12.1-beta version.
I attempted the example code:
```sql
-- Set a variableSET person = 'Alice';-- Use it in a querySELECT
'text' AS component, 'Hello ' || $person AS contents;
```
But I got an error:
[image: image.png]
Also, when I ran the sqlpage.version() function against what I THOUGHT was
the beta version, it reported ...
[image: image.png]
'Sup wit dis?
|
Beta Was this translation helpful? Give feedback.
-
Mea culpa! I'm all set ...
[image: image.png]
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Wed, Sep 27, 2023 at 1:36 PM David Bailey ***@***.***>
wrote:
… Hey,
I'm trying to use the new set variable feature in the v0.12.1-beta version.
I attempted the example code:
-- Set a variableSET person = 'Alice';-- Use it in a querySELECT 'text' AS component, 'Hello ' || $person AS contents;
But I got an error:
[image: image.png]
Also, when I ran the sqlpage.version() function against what I THOUGHT was
the beta version, it reported ...
[image: image.png]
'Sup wit dis?
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
On Tue, Sep 26, 2023 at 7:02 AM David Bailey <
***@***.***> wrote:
> I'm off to the races!
>
> --SQLPage Test Query (sqlpagetestguery.sql) ...
>
> SELECT 'text' AS component;
> SELECT 'Current SQLPage Version is ''v' AS contents;
> SELECT sqlpage.version() AS contents, true AS code;
> SELECT '''' AS contents;
> --INSERT INTO public.test ( tst_id, tst_text) VALUES (1, 'Current SQLPage
> Version is ''v');
> --UPDATE public.test SET tst_text = tst_text || sqlpage.version() WHERE
> tst_id = 1;
> --UPDATE public.test SET tst_text = tst_text || '''' WHERE tst_id = 1);
>
>
> SELECT 'text' AS component;
> SELECT 'Currently running from directory ''' AS contents;
> SELECT sqlpage.current_working_directory() AS contents, true AS code;
> SELECT '''' AS contents;
>
> --INSERT INTO test (tst_id, tst_text) VALUES (2, sqlpage.version())
> RETURNING 'integer-value' AS value, 'string-value' AS value;
>
> SELECT 'table' AS component;
> SELECT * FROM test;
>
> [image: image.png]
> Thanks again! Cheers,
>
> David
>
> -:-
>
> David Bailey
> ***@***.***
>
> 207 691 4123 Cell
> 509 267 7789 Fax
>
> "Any sufficiently advanced technology is indistinguishable from magic."
> Arthur C. Clarke
>
>
> On Tue, Sep 26, 2023 at 12:22 AM David Bailey <
> ***@***.***> wrote:
>
>> Got it ...
>>
>> CREATE TABLE sqlpage_files(
>> INSERT INTO sqlpage_files(path, contents) VALUES ('unit test file.txt',
>> 'Héllö world! 😀');
>>
>>
>> -:-
>>
>> David Bailey
>> ***@***.***
>>
>> 207 691 4123 Cell
>> 509 267 7789 Fax
>>
>> "Any sufficiently advanced technology is indistinguishable from magic."
>> Arthur C. Clarke
>>
>>
>> On Tue, Sep 26, 2023 at 12:18 AM David Bailey <
>> ***@***.***> wrote:
>>
>>> Um, I decided to go with v0.11.1. (:>) Is there a SQL CREATE script
>>> for the sqlpage_files table, so I get the column's data types right?
>>> It works !
>>> If you can see this, then SQLPage v0.11.1 is running correctly on your
>>> server. Congratulations!
>>>
>>>
>>> -:-
>>>
>>> David Bailey
>>> ***@***.***
>>>
>>> 207 691 4123 Cell
>>> 509 267 7789 Fax
>>>
>>> "Any sufficiently advanced technology is indistinguishable from magic."
>>> Arthur C. Clarke
>>>
>>>
>>> On Mon, Sep 25, 2023 at 11:45 PM David Bailey <
>>> ***@***.***> wrote:
>>>
>>>> Hmmm, should I update to the Version 0.11.1 Security update release,
>>>> or the Version 0.12.0-Beta release?
>>>>
>>>> -:-
>>>>
>>>> David Bailey
>>>> ***@***.***
>>>>
>>>> 207 691 4123 Cell
>>>> 509 267 7789 Fax
>>>>
>>>> "Any sufficiently advanced technology is indistinguishable from magic."
>>>> Arthur C. Clarke
>>>>
>>>>
>>>> On Mon, Sep 25, 2023 at 11:40 PM David Bailey <
>>>> ***@***.***> wrote:
>>>>
>>>>> Dear Ophir,
>>>>>
>>>>> Kewl. Your answers/replies are always so helpful and insightful!
>>>>> The more I get of them, the more I understand all things "SQLPage-age!"
>>>>> (:>)
>>>>>
>>>>> Thank you again, my man! Cheers,
>>>>>
>>>>> David
>>>>> -:-
>>>>>
>>>>> David Bailey
>>>>> ***@***.***
>>>>>
>>>>> 207 691 4123 Cell
>>>>> 509 267 7789 Fax
>>>>>
>>>>> "Any sufficiently advanced technology is indistinguishable from
>>>>> magic."
>>>>> Arthur C. Clarke
>>>>>
>>>>>
>>>>> On Mon, Sep 25, 2023 at 6:25 PM Ophir LOJKINE <
>>>>> ***@***.***> wrote:
>>>>>
>>>>>> You can follow releases here:
>>>>>> https://github.com/lovasoa/SQLpage/releases . This will always give
>>>>>> you the latest version. You should upgrade now.
>>>>>> You can watch this repository to be notified of updates, too.
>>>>>>
>>>>>> By the way, can I run the sqlpage.version function from inside of
>>>>>> PGAdmin4, or do I have to do it in an index.sql file from the root folder?
>>>>>>
>>>>>> PgAdmin lets you interact with the database directly, there is no
>>>>>> way it could tell you anything about sqlpage. Functions available in
>>>>>> sqlpage are not run on the database, but inside sqlpage, and their result
>>>>>> is sent to the database before executing the queries. They are not visible
>>>>>> to the database.
>>>>>>
>>>>>> —
>>>>>> Reply to this email directly, view it on GitHub
>>>>>> <#73 (reply in thread)>,
>>>>>> or unsubscribe
>>>>>> <https://github.com/notifications/unsubscribe-auth/ADMYVMC2PZLNCDNSXXPF3LTX4IAEHANCNFSM6AAAAAA4AGKXKM>
>>>>>> .
>>>>>> You are receiving this because you authored the thread.Message ID:
>>>>>> ***@***.***>
>>>>>>
>>>>>
|
Beta Was this translation helpful? Give feedback.
-
Going forward, I shall do so. I thought I was using to the correct venue.
And I'll also adhere to the appropriate formatting standards so that any
code examples are formatted appropriatly and my screen shots actually show
up. I didn't know that they weren't.
Oh, what link shoudl I use for my communications to the general community,
instead of my hooking everything onto that originil email I sent to you?
Anyway, my apologies.
-:-
David Bailey
***@***.***
207 691 4123 Cell
509 267 7789 Fax
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
…On Wed, Sep 27, 2023 at 2:36 PM Ophir LOJKINE ***@***.***> wrote:
Can you please write directly on github, and without signing your messages
each time ? #73 <#73>
This conversation is public, and it would be nice if it were more readable
to others.
Your email formatting appears quite messed up here.
—
Reply to this email directly, view it on GitHub
<#73 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMYVMCDUFNHUUTD6JPG7JTX4RW2ZANCNFSM6AAAAAA4AGKXKM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Yep, I 'discovered; that yesterday when I got a complex query to run! |
Beta Was this translation helpful? Give feedback.
-
What is it you are building exactly? |
Beta Was this translation helpful? Give feedback.
-
"Some of the examples use SQLite-specific SQL syntax, so you have to run them on SQLite" Uh, yeah. but what do you think about converting "those" to PostgreSQL? Not the "make a geographic data application using sqlite extensions" one, because it specifically targets "SpacialLite", so that might not have the same functionality in the PostgreSQL domain. But what about these four (4): • modeling-a-many-to-many-relationship-with-a-form The many-to-many paradigm is common to ALL databases, for instance. Anyway, you could "steer" me and I'd be happy to "drive" the work! (:>) What say you? David P.S. I kinda started to do this for "modeling-a-many-to-many-relationship-with-a-form" already: For example, for its "index.sql" file ...
Then SELECT 'list' as component, COALESCE((SELECT name FROM topic WHERE id = $topic becomes SELECT 'list' as component,
COALESCE(
(SELECT name FROM topic WHERE id = (SELECT COALESCE(MAX(id), 0) + 1 FROM post)),
'Recent blog posts'
) as title; and CASE
WHEN created_at > date('now', '-2 days') THEN 'red'
ELSE NULL
END as color, becomes CASE
WHEN created_at > current_date - interval '2 days' THEN 'red'
ELSE NULL
END as color, Then the code runs without error: |
Beta Was this translation helpful? Give feedback.
-
OL, Small broken link typo: In the Official Website page (https://sql.ophir.dev/), the link for the "Tutorial" button: "http://localhost:8080/get%20started.sql" doesn't work. 'I believe' it should be underscore '_' between the words Let me know if I am wrong. (:>) Ta, |
Beta Was this translation helpful? Give feedback.
-
Howdy. So, I've read through the SQLPage info on the website, trying to pay attention to the How It Works piece.
I downloaded the Zip file (Windows 11) containing the single sqlpage.exe server file. I placed the downloaded server in the SQLPage root folder I created, as instructed. I created the folder structure suggested: ...\migrations, ...\templates, et cetera. I launched the server and got the "[2023-08-27T09:22:09Z INFO sqlpage] Starting server on 0.0.0.0:8080" message expected. I opened the website locally by entering into my browser: http://localhost:8080. I got the page displayed that said: "It works ! If you can see this, then SQLPage is running correctly on your server. Congratulations!"
So, now, my question: How do I get SQLPage to run SQL queries against my PostgreSQL database? And how do I get the examples listed in (https://github.com/lovasoa/SQLpage/tree/main/examples) to run against my PostgreSQL database as well?
I currently use the PGAdmin 4 tool to run queries against my PostgreSQL database. I'm failing to see how SQLPage connects to my PostgreSQL database. I can't find the examples that show how to use the SQLPage connection parameters for PostgreSQL. They're probably right under my nose, but I'm nor grokking the process.
Any advice/assistance will be welcomed. (:>)
Cheers,
David
Beta Was this translation helpful? Give feedback.
All reactions