4 ms·
Interesting concept. It's always intriguing to me that no major database vendors have added support for Python, Javascript, Lua, et. al, for their expression a
by BeefWellington 5y ago
Interesting concept.
It's always intriguing to me that no major database vendors have added support for Python, Javascript, Lua, et. al, for their expression and stored procedure definition languages. It would really make things more accessible than Transact-SQL[1], Oracle's P/SQL[2] or DB2's messy external procedure support.[3]
[1]: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/t-sql/statements/create...
[2]: https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6009.htm https://docs.oracle.com/cd/B19306_01/server.102/b14200/state...
[3]: https://www.ibm.com/docs/en/db2/11.5?topic=statements-create-procedure-external https://www.ibm.com/docs/en/db2/11.5?topic=statements-create...
- ako 5y agoOracle has had java support in the RDBMS for more than 20 years, probably more than 25 years...
- shrikant 5y agoRedshift lets you create UDFs in Python (2.7), and via Lambda functions (for any language runtime supported by AWS Lambda). https://docs.aws.amazon.com/redshift/latest/dg/user-defined-functions.html https://docs.aws.amazon.com/redshift/latest/dg/user-defined-...
- adeelk93 5y agoBigQuery supports JavaScript UDFs [1]. But I bet Python isn’t popular in a database for performance reasons. [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-functions#javascript-udf-structure https://cloud.google.com/bigquery/docs/reference/standard-sq...
- jaguar1878 5y agoYou may find this interesting: https://docs.oracle.com/en/graalvm/enterprise/21/docs/examples/mle-oracle/ https://docs.oracle.com/en/graalvm/enterprise/21/docs/exampl... Examples show Javascript execution.
- BeefWellington 5y agoI stand corrected! Thanks for passing that along. It's been awhile since I worked with Oracle (last was an 11g instance).
- mixmastamyk 5y agoPostgres has supported Python for quite a while.
- tacone 5y agoPostgres also supports Javascript
- dmoura 5y agoyep, unfortunately due to security concerns is not supported everywhere (DB as a service): `ERROR: Extension "plpythonu" is not supported by Amazon RDS`
- BeefWellington 5y agoUnfortunately the Postgres implementation is marked unsafe for a reason. There's not a sufficient sandbox in place to prevent shenanigans.
- mixmastamyk 5y agoIf you’re writing the code and sanitizing inputs you only have yourself to blame. Just like every other app ever written?
- hoppla 5y agoMongoDB supports JavaScript
- tasogare 5y agoC# and few other .net languages can be used in SQL Server for more than a decade: https://en.m.wikipedia.org/wiki/SQL_CLR https://en.m.wikipedia.org/wiki/SQL_CLR
- BeefWellington 5y agoYes, but similar to Python on Postgresql, it comes with a bunch of security warnings attached. I should have clarified in my original post but I'm envisioning more of: database server has a parser that understands python/javascript/c#/etc but projects a subset of library functions to avoid security dangers. Essentially, expose the same functionality stored procedures already have but in a more accessible syntax. What vendors mostly seem to have opted for is embedding the full language parsers directly into the database servers, which yields a lot of power and a lot of risk.