Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Support includes
  • Loading branch information
akrambek committed Sep 20, 2024
commit f815a9b6f3e6a0739f217e0fae10285fa2267306
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ write zilla:data.ext ${pgsql:dataEx()
.build()
.build()}
write "CREATE SOURCE IF NOT EXISTS weather (*)\n"
"INCLUDE header'zilla:correlation-id' AS correlation_id\n"
"INCLUDE header 'zilla:identity' AS owner_id"
"INCLUDE timestamp as timestamp\n"
"INCLUDE header 'zilla:correlation-id' AS correlation_id\n"
"INCLUDE timestamp AS timestamp\n"
"INCLUDE header 'zilla:identity' AS owner_id\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
" topic='dev.weather',\n"
" scan.startup.mode='latest',\n"
" scan.startup.timestamp.millis='140000000'\n"
")\n"
") FORMAT UPSERT ENCODE AVRO (\n"
") FORMAT PLAIN ENCODE AVRO (\n"
" schema.registry = 'http://localhost:8081'\n"
");"
[0x00]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@ read zilla:data.ext ${pgsql:dataEx()
.query()
.build()
.build()}
read "CREATE SOURCE IF NOT EXISTS weather (*)\n"
"INCLUDE header'zilla:correlation-id' AS correlation_id\n"
"INCLUDE header 'zilla:identity' AS owner_id"
"INCLUDE timestamp as timestamp\n"
read "CREATE SOURCE IF NOT EXISTS weather (*)\n"
"INCLUDE header 'zilla:correlation-id' AS correlation_id\n"
"INCLUDE timestamp AS timestamp\n"
"INCLUDE header 'zilla:identity' AS owner_id\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
" topic='dev.weather',\n"
" scan.startup.mode='latest',\n"
" scan.startup.timestamp.millis='140000000'\n"
")\n"
") FORMAT UPSERT ENCODE AVRO (\n"
") FORMAT PLAIN ENCODE AVRO (\n"
" schema.registry = 'http://localhost:8081'\n"
");"
[0x00]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

connect "zilla://streams/app1"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${pgsql:beginEx()
.typeId(zilla:id("pgsql"))
.parameter("user", "root")
.parameter("database", "dev")
.parameter("application_name", "psql")
.parameter("client_encoding", "UTF8")
.build()}

connected

write zilla:data.ext ${pgsql:dataEx()
.typeId(zilla:id("pgsql"))
.query()
.build()
.build()}
write "CREATE TABLE IF NOT EXISTS cities (\n"
" *,\n"
" PRIMARY KEY (key)\n"
")\n"
"INCLUDE KEY AS key\n"
"INCLUDE header 'zilla:correlation-id' AS correlation_id\n"
"INCLUDE timestamp AS timestamp\n"
"INCLUDE header 'zilla:identity' AS owner_id\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
" topic='dev.cities',\n"
" scan.startup.mode='latest',\n"
" scan.startup.timestamp.millis='140000000'\n"
") FORMAT UPSERT ENCODE AVRO (\n"
" schema.registry = 'http://localhost:8081'\n"
");"
[0x00]

write flush

read advised zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.completion()
.tag("CREATE_TABLE")
.build()
.build()}

read advised zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.ready()
.status("IDLE")
.build()
.build()}


connect "zilla://streams/app2"
option zilla:window 8192
option zilla:transmission "duplex"


write zilla:begin.ext ${pgsql:beginEx()
.typeId(zilla:id("pgsql"))
.parameter("user", "root")
.parameter("database", "dev")
.parameter("application_name", "psql")
.parameter("client_encoding", "UTF8")
.build()}

connected

write zilla:data.ext ${pgsql:dataEx()
.typeId(zilla:id("pgsql"))
.query()
.build()
.build()}
write "CREATE TOPIC IF NOT EXISTS cities "
"(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));"
[0x00]
write flush

read advised zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.completion()
.tag("CREATE_TOPIC")
.build()
.build()}

read advised zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.ready()
.status("IDLE")
.build()
.build()}

Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

accept "zilla://streams/app1"
option zilla:window 8192
option zilla:transmission "duplex"

accepted

read zilla:begin.ext ${pgsql:beginEx()
.typeId(zilla:id("pgsql"))
.parameter("user", "root")
.parameter("database", "dev")
.parameter("application_name", "psql")
.parameter("client_encoding", "UTF8")
.build()}

connected

read await CREATE_TOPIC_COMPLETED

read zilla:data.ext ${pgsql:dataEx()
.typeId(zilla:id("pgsql"))
.query()
.build()
.build()}
read "CREATE TABLE IF NOT EXISTS cities (\n"
" *,\n"
" PRIMARY KEY (key)\n"
")\n"
"INCLUDE KEY AS key\n"
"INCLUDE header 'zilla:correlation-id' AS correlation_id\n"
"INCLUDE timestamp AS timestamp\n"
"INCLUDE header 'zilla:identity' AS owner_id\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
" topic='dev.cities',\n"
" scan.startup.mode='latest',\n"
" scan.startup.timestamp.millis='140000000'\n"
") FORMAT UPSERT ENCODE AVRO (\n"
" schema.registry = 'http://localhost:8081'\n"
");"
[0x00]

write advise zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.completion()
.tag("CREATE_TABLE")
.build()
.build()}

write advise zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.ready()
.status("IDLE")
.build()
.build()}

accept "zilla://streams/app2"
option zilla:window 8192
option zilla:transmission "duplex"

accepted

read zilla:begin.ext ${pgsql:beginEx()
.typeId(zilla:id("pgsql"))
.parameter("user", "root")
.parameter("database", "dev")
.parameter("application_name", "psql")
.parameter("client_encoding", "UTF8")
.build()}

connected

read zilla:data.ext ${pgsql:dataEx()
.typeId(zilla:id("pgsql"))
.query()
.build()
.build()}
read "CREATE TOPIC IF NOT EXISTS cities "
"(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));"
[0x00]

write advise zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.completion()
.tag("CREATE_TOPIC")
.build()
.build()}

write notify CREATE_TOPIC_COMPLETED

write advise zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.ready()
.status("IDLE")
.build()
.build()}


Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ write zilla:data.ext ${pgsql:dataEx()
write "CREATE TABLE IF NOT EXISTS cities (\n"
" *,\n"
" PRIMARY KEY (key)\n"
") INCLUDE KEY AS key\n"
")\n"
"INCLUDE KEY AS key\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ read zilla:data.ext ${pgsql:dataEx()
read "CREATE TABLE IF NOT EXISTS cities (\n"
" *,\n"
" PRIMARY KEY (key)\n"
") INCLUDE KEY AS key\n"
")\n"
"INCLUDE KEY AS key\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ write zilla:data.ext ${pgsql:dataEx()
write "CREATE TABLE IF NOT EXISTS cities (\n"
" *,\n"
" PRIMARY KEY (key)\n"
") INCLUDE KEY AS key\n"
")\n"
"INCLUDE KEY AS key\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ read zilla:data.ext ${pgsql:dataEx()
read "CREATE TABLE IF NOT EXISTS cities (\n"
" *,\n"
" PRIMARY KEY (key)\n"
") INCLUDE KEY AS key\n"
")\n"
"INCLUDE KEY AS key\n"
"WITH (\n"
" connector='kafka',\n"
" properties.bootstrap.server='localhost:9092',\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ write zilla:data.ext ${pgsql:dataEx()
write "CREATE TABLE IF NOT EXISTS weather "
"(city VARCHAR, temperature DOUBLE, date DATE)\n"
"INCLUDE zilla_correlation_id AS correlation_id\n"
"INCLUDE zilla_identity AS ownerid\n"
"INCLUDE zilla_identity AS owner_id\n"
"INCLUDE timestamp as timestamp;"
[0x00]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ read zilla:data.ext ${pgsql:dataEx()
.query()
.build()
.build()}
read "CREATE TABLE IF NOT EXISTS weather "
read "CREATE TABLE IF NOT EXISTS weather "
"(city VARCHAR, temperature DOUBLE, date DATE)\n"
"INCLUDE zilla_correlation_id AS correlation_id\n"
"INCLUDE zilla_identity AS ownerid\n"
"INCLUDE zilla_identity AS owner_id\n"
"INCLUDE timestamp as timestamp;"
[0x00]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

connect "zilla://streams/app0"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${pgsql:beginEx()
.typeId(zilla:id("pgsql"))
.parameter("user", "root")
.parameter("database", "dev")
.parameter("application_name", "psql")
.parameter("client_encoding", "UTF8")
.build()}

connected

write zilla:data.ext ${pgsql:dataEx()
.typeId(zilla:id("pgsql"))
.query()
.build()
.build()}
write "CREATE TABLE IF NOT EXISTS cities "
"(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id))\n"
"INCLUDE zilla_correlation_id AS correlation_id\n"
"INCLUDE zilla_identity AS owner_id\n"
"INCLUDE timestamp as timestamp;"
[0x00]

write flush

read advised zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.completion()
.tag("CREATE_TABLE")
.build()
.build()}

read advised zilla:flush ${pgsql:flushEx()
.typeId(zilla:id("pgsql"))
.ready()
.status("IDLE")
.build()
.build()}

Loading