Skip to content

sqlite-bro broken in python-3.13.0b1 #1337

Closed
@stonebig

Description

@stonebig

the example of custom fonction (py_sin) doesn't work.

but this manual program works:

import sqlite3
def _customFun(fstring, dept):
    result = 'Welcome ' + fstring + ' your dept is ' + dept
    return result


connection = sqlite3.connect(":memory:")
cursor = connection.cursor()
connection.create_function("ROHACK", 2, _customFun)
sql="CREATE TABLE student (First_Name, Department, Student_ID);"
cursor.execute(sql)
sql='INSERT INTO student values("Toto","LLM class", 1)'
cursor.execute(sql)

sqlQuery = "select ROHACK(First_Name,Department) from student where Student_ID = 1"
cursor.execute(sqlQuery)
print(*cursor.fetchone())

cursor.close()
connection.close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions