-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update github repo url.
- Loading branch information
Showing
5 changed files
with
129 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[![Java CI with Maven](https://github.com/kai-niemi/roach-pipeline/actions/workflows/maven.yml/badge.svg?branch=main)](https://github.com/kai-niemi/roach-pipeline/actions/workflows/maven.yml) | ||
[![Java CI with Maven](https://github.com/cloudneutral/roach-pipeline/actions/workflows/maven.yml/badge.svg?branch=main)](https://github.com/cloudneutral/roach-pipeline/actions/workflows/maven.yml) | ||
|
||
# Pipeline | ||
|
||
|
@@ -89,7 +89,7 @@ Confirm the installation by running: | |
|
||
## Clone the project | ||
|
||
git clone [email protected]:kai-niemi/roach-pipeline.git pipeline | ||
git clone [email protected]:cloudneutral/roach-pipeline.git pipeline | ||
|
||
## Build the executable jar | ||
|
||
|
@@ -199,7 +199,4 @@ To disable the shell, use: | |
|
||
# Terms of Use | ||
|
||
This tool is an experimental prototype and not supported by Cockroach Labs. Use of this driver | ||
is entirely at your own risk and Cockroach Labs makes no guarantees or warranties about its operation. | ||
|
||
See [MIT](LICENSE.txt) for terms and conditions. |
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,80 @@ | ||
# DDL for PSQL | ||
|
||
```sql | ||
drop table transaction_item cascade ; | ||
drop table transaction cascade ; | ||
drop table account cascade ; | ||
|
||
create table account | ||
( | ||
id int, | ||
balance numeric(19, 2) not null, | ||
currency varchar(64) not null, | ||
name varchar(128) not null, | ||
|
||
primary key (id) | ||
); | ||
|
||
create table transaction | ||
( | ||
id int not null, | ||
booking_date date null, | ||
primary key (id) | ||
); | ||
|
||
create table transaction_item | ||
( | ||
transaction_id int not null, | ||
account_id int not null, | ||
amount numeric(19, 2) not null, | ||
currency varchar(64) not null, | ||
running_balance numeric(19, 2) not null, | ||
note varchar(255), | ||
|
||
primary key (transaction_id, account_id) | ||
); | ||
|
||
alter table transaction_item | ||
add constraint fk_txn_item_ref_transaction | ||
foreign key (transaction_id) references transaction (id); | ||
alter table transaction_item | ||
add constraint fk_txn_item_ref_account | ||
foreign key (account_id) references account (id); | ||
``` | ||
|
||
# DML for PSQL | ||
|
||
```sql | ||
insert into account (id,balance,currency,name) | ||
select no, | ||
500.00 + random() * 500.00, | ||
'USD', | ||
md5(random()::text) | ||
from generate_series(1, 10) no; | ||
|
||
insert into transaction (id,booking_date) | ||
select no, | ||
now()::date | ||
from generate_series(1, 500000) no; | ||
|
||
insert into transaction_item (transaction_id,account_id,amount,currency,running_balance,note) | ||
select no, | ||
round(1 + random() * 9), | ||
500.00 + random() * 500.00, | ||
'USD', | ||
500.00 + random() * 500.00, | ||
'Cockroaches can eat anything' | ||
from generate_series(1, 500000) no; | ||
``` | ||
|
||
# Get and Post forms | ||
|
||
pg_dump --dbname=crdb_test --table=transaction_item --schema-only | ||
curl -X GET http://localhost:8090/sql2sql/form?table=account > account.json | ||
curl -X GET http://localhost:8090/sql2sql/form?table=transaction > transaction.json | ||
curl -X GET http://localhost:8090/sql2sql/form?table=transaction_item > transaction_item.json | ||
curl -X GET http://localhost:8090/datasource/source-tables | grep topologyOrder | ||
curl -d "@account.json" -H "Content-Type:application/json" -X POST http://localhost:8090/sql2sql | ||
curl -d "@transaction.json" -H "Content-Type:application/json" -X POST http://localhost:8090/sql2sql | ||
curl -d "@transaction_item.json" -H "Content-Type:application/json" -X POST http://localhost:8090/sql2sql | ||
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<html xmlns="http://www.w3.org/1999/html"> | ||
<body> | ||
<p> | ||
See <a href="https://github.com/kai-niemi/roach-pipeline/docs" target="_blank">Pipeline REST API Guide</a>. | ||
See <a href="https://github.com/cloudneutral/roach-pipeline/docs" target="_blank">Pipeline REST API Guide</a>. | ||
</p> | ||
</body> | ||
</html> |