What is the currently recommended way to access a postgres database?

My search made it look like the LibPQ.jl wrapper would be the most popular way to access a PostgreSQL database.

Is there something else I should look at?

FWIW, I use LibPQ.jl without any issue

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)

You may find some more ideas here: Easiest and most complete package for PostgreSQL right now (Feb 2022)?

1 Like