-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the tiny-twitter example from pgconf.eu 2023
- Loading branch information
Showing
7 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
Submodule tiny_twitter
deleted from
6d472f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sqlpage.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM lovasoa/sqlpage:main | ||
|
||
COPY sqlpage /etc/sqlpage | ||
COPY . /var/www/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Tiny Tweeter | ||
|
||
This is a simple example of a very simple Twitter-like application running on top of PostgreSQL. | ||
It is called tweeter because Elon Musk already has the Twitter trademark, even though he doesn't use it. | ||
|
||
It was presented at the [2023 PGConf.EU](https://2023.pgconf.eu/) conference. | ||
|
||
You can find the slides at https://sql.ophir.dev/pgconf/pgconf-2023.html. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
sqlpage: | ||
build: . | ||
ports: ["8080:8080"] | ||
volumes: [".:/var/www"] | ||
depends_on: [postgres] | ||
environment: | ||
- DATABASE_URL=postgres://root:root@postgres/sqlpage | ||
postgres: | ||
image: postgres:16 | ||
ports: ["5432:5432"] | ||
environment: | ||
- POSTGRES_USER=root | ||
- POSTGRES_PASSWORD=root | ||
- POSTGRES_DB=sqlpage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
select 'shell' as component, | ||
'TinyTweeter' as title; | ||
|
||
select 'form' as component, | ||
'Tweet' as validate; | ||
select 'new_tweet' as name, | ||
'Your story' as label, | ||
'textarea' as type, | ||
'Tell me your story...' as placeholder; | ||
select 'checkbox' as type, | ||
'Terms and conditions' as label, | ||
true as required; | ||
|
||
insert into tweets (tweet) | ||
select :new_tweet | ||
where :new_tweet is not null; | ||
|
||
select 'card' as component, | ||
'Tweets' as title, | ||
1 as columns; | ||
select tweet as description | ||
from tweets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE TABLE tweets( | ||
id bigserial, | ||
tweet text | ||
); |