Skip to content

Commit ca8bdac

Browse files
authored
feat: fix type issues (#50)
* feat: fix type issues * chore: changelog fragment
1 parent 34c55b8 commit ca8bdac

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixed
2+
body: Fixed missing `__init__` return type annotation and connection parameter type when using `asyncpg` driver.
3+
time: 2025-05-06T09:54:00.0000000+01:00
4+
custom:
5+
Author: tandemdude
6+
PR: "50"

internal/codegen/drivers/asyncpg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010
)
1111

12-
const AsyncpgConn = "asyncpg.Connection"
12+
const AsyncpgConn = "asyncpg.Connection[asyncpg.Record]"
1313

1414
func AsyncpgBuildPyQueryFunc(query *core.Query, body *builders.IndentStringBuilder, args []string, retType string, isClass bool) error {
1515
indentLevel := 0

internal/codegen/queries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (dr *Driver) buildClassTemplate(sourceName string, body *builders.IndentStr
8080
body.WriteLine(fmt.Sprintf("class %s:", className))
8181
body.WriteIndentedLine(1, `__slots__ = ("_conn",)`)
8282
body.NewLine()
83-
body.WriteIndentedLine(1, fmt.Sprintf(`def __init__(self, conn: %s):`, dr.connType))
83+
body.WriteIndentedLine(1, fmt.Sprintf(`def __init__(self, conn: %s) -> None:`, dr.connType))
8484
body.WriteIndentedLine(2, "self._conn = conn")
8585
body.NewLine()
8686
return className

0 commit comments

Comments
 (0)