You can query any Postgres table from Luabase and merge / include the data in any other Luabase query.
Click on “Settings”
Click “Add” under Postgres

Add the connection properties (note: your connection details are encrypted before storage). We suggest creating a “read only” user specifically for Luabase with access to only the data you need in Luabase.

Create a new block
Add a parameter {{my_pg_table}} and select Postgres as the type

Select the integration you just added and the schema.table_name for your table
Run the query! A simple select * from {{my_pg_table}} will return the full table
We suggested querying Postgres with a CTE before joining to Luabase data to keep your code organized
with pg as (
select "address" from {{my_pg_table}}
)
select t.to_address, t.block_timestamp, t.value
from ethereum.transactions as t
where t.to_address in (select "address" from pg)