- The
LibPQ.jl
is the preferred.- Alternative: ODBC.jl
- Future: PL/Julia ( pljulia / pljulia · GitLab ) as moving the “julia” code to the server side;
( disclaimer: I am a committer )
IMHO: now it is usable, but still in ~developer only status.
it was a GSOC 2021 project: Create procedural language extension for the Julia programming language
pljulia example ( from the readme ):
CREATE FUNCTION julia_setof_int()
RETURNS SETOF INTEGER AS $$
for i in 1:5
return_next(i)
end
$$ LANGUAGE pljulia;
SELECT julia_setof_int();
julia_setof_int
-----------------
1
2
3
4
5
(5 rows)
CREATE FUNCTION julia_setof_array()
RETURNS SETOF INTEGER[] AS $$
x =[[1,2], [3,4]]
for i in x
return_next(i)
end
$$ LANGUAGE pljulia;
SELECT julia_setof_array();
julia_setof_array
-------------------
{1,2}
{3,4}
(2 rows)