News for hackers. Stuff that matters.
Re:Extending SQLite with Rust by bob1029 on Monday September 05, 2022 @02:42PM (#32727699)
This is great to see. We've been using UDFs with SQLite and .NET for about 3 years now.

With just a little bit of imagination, you can build a very powerful domain-specific language on top of a SQL dialect. There is nothing that says your new SQL functions have to be free from side effects either.

You can also do some crazy stuff with recursive SQL evaluation. I.e. a UDF that executes raw SQL command text, which itself can contain the same invocation. Bonus points if this command text resides in the same database and can reflect/edit itself at runtime...

Re:Extending SQLite with Rust by polyrand on Monday September 05, 2022 @02:56PM (#32727854)
Yes! I love UDFs in SQLite:

1. I can just write functions in whatever programming language I want.

2. Not having to worry as much about overwriting other UDFs, since different connections can have the same UDF with a different implementation.

3. Having the DB (SQLite) and the function definitions in the same application code and in the same process makes some things a lot easier and flexible.

I actually wrote about that too:

https://ricardoanderegg.com/posts/sqlite-developer-experienc...

Re:Extending SQLite with Rust by bear24rw on Tuesday September 06, 2022 @12:21AM (#32732799)
> You can also do some crazy stuff with recursive SQL evaluation. I.e. a UDF that executes raw SQL command text, which itself can contain the same invocation. Bonus points if this command text resides in the same database and can reflect/edit itself at runtime...

This is super intriguing, would love to see more details / examples of this.