-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from sqlite to postgres for federation sample
- Loading branch information
Showing
5 changed files
with
26 additions
and
33 deletions.
There are no files selected for viewing
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
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
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,12 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
createdb federation_sample | ||
|
||
psql federation_sample -e <<-EOS | ||
CREATE TABLE people (id character varying, name character varying, domain character varying); | ||
INSERT INTO people (id, name, domain) VALUES | ||
('GD2GJPL3UOK5LX7TWXOACK2ZPWPFSLBNKL3GTGH6BLBNISK4BGWMFBBG', 'bob', 'stellar.org'), | ||
('GCYMGWPZ6NC2U7SO6SMXOP5ZLXOEC5SYPKITDMVEONLCHFSCCQR2J4S3', 'alice', 'stellar.org'); | ||
EOS |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
port = 8000 | ||
|
||
[database] | ||
type = "sqlite3" | ||
url = "./federation-sqlite-sample" | ||
type = "postgres" | ||
url = "postgres://localhost/federation_sample?sslmode=disable" | ||
|
||
[queries] | ||
federation = "SELECT accountId as id FROM Users WHERE name = ? AND ? = 'stellar.org'" | ||
reverse-federation = "SELECT name, 'stellar.org' FROM Users WHERE accountId = ?" | ||
federation = "SELECT id FROM people WHERE name = ? AND domain = ?" | ||
reverse-federation = "SELECT name, domain FROM people WHERE id = ?" |
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