Skip to content

Commit

Permalink
Merge pull request #403 from EvgSkv/ti2023
Browse files Browse the repository at this point in the history
Allow custom logica_home on DuckDB.
  • Loading branch information
EvgSkv authored Nov 8, 2024
2 parents ae9573d + 99f8084 commit 0ade093
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,13 @@ def Preamble(self):
'-- Empty logica type: logicarecord893574736;\n'
"DO $$ BEGIN if not exists (select 'I(am) :- I(think)' from pg_type where typname = 'logicarecord893574736') then create type logicarecord893574736 as (nirvana numeric); end if; END $$;\n\n")
elif self.Engine() == 'duckdb':
preamble += (
'-- Initializing DuckDB environment.\n'
home_attachment = (
'create schema if not exists logica_home;\n'
if 'logica_home' not in self.AttachedDatabases()
else '-- logica_home attached by user.\n')
preamble += (
'-- Initializing DuckDB environment.\n' +
home_attachment +
'-- Empty record, has to have a field by DuckDB syntax.\n'
'drop type if exists logicarecord893574736 cascade; create type logicarecord893574736 as struct(nirvana numeric);\n'
)
Expand Down

0 comments on commit 0ade093

Please sign in to comment.