Skip to content

Commit 48cee2e

Browse files
authored
Merge pull request #126 from enobayram/explicit-text-cast-for-pg_proc-char-columns
Cast pg_proc char columns to Text explicitly
2 parents 9c82d77 + 7915f4e commit 48cee2e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 0.16
44

5+
### 0.16.2
6+
7+
- fix: Cast pg_proc char columns to Text explicitly
8+
59
### 0.16.1
610

711
- fix: Use bind params regex from sqlalchemy while escaping colons.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sqlalchemy-declarative-extensions"
3-
version = "0.16.1"
3+
version = "0.16.2"
44
authors = [
55
{name = "Dan Cardin", email = "ddcardin@gmail.com"},
66
]

src/sqlalchemy_declarative_extensions/dialects/postgresql/schema.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
from sqlalchemy import (
66
String,
7+
Text,
78
and_,
89
bindparam,
10+
cast,
911
column,
1012
exists,
1113
func,
@@ -352,9 +354,9 @@ def get_types(arg_type_oids):
352354
pg_type.c.typname.label("base_return_type"),
353355
pg_proc.c.prosrc.label("source"),
354356
pg_proc.c.prosecdef.label("security_definer"),
355-
pg_proc.c.prokind.label("kind"),
357+
cast(pg_proc.c.prokind, Text).label("kind"),
356358
func.pg_get_function_arguments(pg_proc.c.oid).label("parameters"),
357-
pg_proc.c.provolatile.label("volatility"),
359+
cast(pg_proc.c.provolatile, Text).label("volatility"),
358360
func.pg_get_function_result(pg_proc.c.oid).label("return_type_string"),
359361
pg_proc.c.proargnames.label("arg_names"),
360362
pg_proc.c.proargmodes.label("arg_modes"),

0 commit comments

Comments
 (0)