ipython-sql icon indicating copy to clipboard operation
ipython-sql copied to clipboard

Question: Support for SQLite UDFs?

Open jonnickerson opened this issue 6 years ago • 1 comments

Hello, first off I absolutely love your work here.

But is there any existing support for creating custom SQLite functions or could it be added?

Example:

from sqlalchemy import create_engine

conn = create_engine('sqlite://')
conn.execute('create table test(example_txt_col text)')
conn.execute("insert into test values ('example text')")

def to_upper(txt):
	return txt.upper()

connection = conn.raw_connection()
connection.create_function('to_upper', 1, to_upper)
print(conn.execute("select to_upper(example_txt_col) words from test").fetchall()[0][0])

jonnickerson avatar Feb 03 '19 15:02 jonnickerson

this is supported beginning in version 0.5.1 of our fork

edublancas avatar Dec 30 '22 21:12 edublancas