Skip to content

Commit eba039d

Browse files
authored
Merge pull request #39 from oracle/feature/dbt-core1.2
Support for dbt-core 1.2
2 parents 9e56f16 + 217ae59 commit eba039d

File tree

12 files changed

+434
-25
lines changed

12 files changed

+434
-25
lines changed

.github/workflows/oracle-xe-adapter-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Install dbt-oracle with core dependencies
4646
run: |
4747
python -m pip install --upgrade pip
48-
pip install pytest dbt-tests-adapter==1.1.2
48+
pip install pytest dbt-tests-adapter==1.2.0
4949
pip install -r requirements.txt
5050
pip install -e .
5151

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ doc/build.gitbak
142142
.venv1.1.0
143143
.venv
144144
.bldenv
145-
145+
.venv1.2/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration variables
2-
VERSION=1.1.2
2+
VERSION=1.2.0
33
PROJ_DIR?=$(shell pwd)
44
VENV_DIR?=${PROJ_DIR}/.bldenv
55
BUILD_DIR=${PROJ_DIR}/build

dbt/adapters/oracle/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
version = "1.1.2"
17+
version = "1.2.0"

dbt/include/oracle/macros/adapters.sql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
'SYNONYM',
5959
'MATERIALIZED VIEW'
6060
)
61-
AND owner = '{{ schema | upper }}')
61+
AND upper(owner) = '{{ schema | upper }}')
6262
LOOP
6363
BEGIN
6464
IF cur_rec.object_type = 'TABLE'
@@ -130,8 +130,8 @@
130130
{% call statement('get_columns_in_relation', fetch_result=True) %}
131131
with columns as (
132132
select
133-
UPPER(SYS_CONTEXT('userenv', 'DB_NAME')) table_catalog,
134-
UPPER(owner) table_schema,
133+
SYS_CONTEXT('userenv', 'DB_NAME') table_catalog,
134+
owner table_schema,
135135
table_name,
136136
column_name,
137137
data_type,
@@ -178,9 +178,9 @@
178178
numeric_precision as "numeric_precision",
179179
numeric_scale as "numeric_scale"
180180
from columns
181-
where table_name = upper('{{ relation.identifier }}')
181+
where upper(table_name) = upper('{{ relation.identifier }}')
182182
{% if relation.schema %}
183-
and table_schema = upper('{{ relation.schema }}')
183+
and upper(table_schema) = upper('{{ relation.schema }}')
184184
{% endif %}
185185
order by ordinal_position
186186

@@ -314,8 +314,8 @@
314314
{% macro oracle__list_relations_without_caching(schema_relation) %}
315315
{% call statement('list_relations_without_caching', fetch_result=True) -%}
316316
with tables as
317-
(select UPPER(SYS_CONTEXT('userenv', 'DB_NAME')) table_catalog,
318-
UPPER(owner) table_schema,
317+
(select SYS_CONTEXT('userenv', 'DB_NAME') table_catalog,
318+
owner table_schema,
319319
table_name,
320320
case
321321
when iot_type = 'Y'
@@ -326,8 +326,8 @@
326326
end table_type
327327
from sys.all_tables
328328
union all
329-
select UPPER(SYS_CONTEXT('userenv', 'DB_NAME')),
330-
UPPER(owner),
329+
select SYS_CONTEXT('userenv', 'DB_NAME'),
330+
owner,
331331
view_name,
332332
'VIEW'
333333
from sys.all_views
@@ -341,7 +341,7 @@
341341
end as "kind"
342342
from tables
343343
where table_type in ('BASE TABLE', 'VIEW')
344-
and table_schema = upper('{{ schema_relation.schema }}')
344+
and upper(table_schema) = upper('{{ schema_relation.schema }}')
345345
{% endcall %}
346346
{{ return(load_result('list_relations_without_caching').table) }}
347347
{% endmacro %}

dbt/include/oracle/macros/catalog.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
from sys.all_tab_columns
7272
),
7373
tables as
74-
(select UPPER(SYS_CONTEXT('userenv', 'DB_NAME')) table_catalog,
75-
UPPER(owner) table_schema,
74+
(select SYS_CONTEXT('userenv', 'DB_NAME') table_catalog,
75+
owner table_schema,
7676
table_name,
7777
case
7878
when iot_type = 'Y'
@@ -117,7 +117,7 @@
117117
and all_col_comments.column_name = columns.column_name
118118
where (
119119
{%- for schema in schemas -%}
120-
tables.table_schema = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}
120+
upper(tables.table_schema) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}
121121
{%- endfor -%}
122122
)
123123
order by

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dbt-core==1.1.2
1+
dbt-core==1.2.0
22
cx_Oracle==8.3.0
33
oracledb==1.0.3
44

requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ tox
66
coverage
77
twine
88
pytest
9-
dbt-tests-adapter==1.1.2
9+
dbt-tests-adapter==1.2.0

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = dbt-oracle
3-
version = 1.1.2
3+
version = 1.2.0
44
description = dbt (data build tool) adapter for the Oracle database
55
long_description = file: README.md
66
long_description_content_type = text/markdown
@@ -32,12 +32,12 @@ zip_safe = False
3232
packages = find:
3333
include_package_data = True
3434
install_requires =
35-
dbt-core==1.1.2
35+
dbt-core==1.2.0
3636
cx_Oracle==8.3.0
3737
oracledb==1.0.3
3838
test_suite=tests
3939
test_requires =
40-
dbt-tests-adapter==1.1.2
40+
dbt-tests-adapter==1.2.0
4141
pytest
4242
scripts =
4343
bin/create-pem-from-p12

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232

3333

3434
requirements = [
35-
"dbt-core==1.1.2",
35+
"dbt-core==1.2.0",
3636
"cx_Oracle==8.3.0",
3737
"oracledb==1.0.3"
3838
]
3939

4040
test_requirements = [
41-
"dbt-tests-adapter==1.1.2",
41+
"dbt-tests-adapter==1.2.0",
4242
"pytest"
4343
]
4444

@@ -52,7 +52,7 @@
5252

5353
url = 'https://github.com/oracle/dbt-oracle'
5454

55-
VERSION = '1.1.2'
55+
VERSION = '1.2.0'
5656
setup(
5757
author="Oracle",
5858
python_requires='>=3.7.2',

0 commit comments

Comments
 (0)