PostgreSQL procedural language handler for Clojure via SCI

Overview

pl/sci

project chat

Status

This is very much an experiment and I'm open to feedback on where to take this next.

Build

Requirements

Steps

  1. Set GRAALVM_HOME to your GraalVM directory (the one that contains the bin directory).

  2. Run script/compile-libplsci. Currently this build script contains some macOS-specific things like .dylib and install_name_tool. This will be made more portable later on (PR welcome).

  3. Run cargo pgx run pg13. Then try it out:

psql (13.0)
Type "help" for help.

plsci=# create extension plsci;
CREATE EXTENSION

plsci=# select * from plsci('(+ 1 2 3)');
 plsci
-------
 6
(1 row)

License

Copyright Β© 2021 Michiel Borkent

Distributed under the EPL License. See LICENSE.

You might also like...
Teach your PostgreSQL database how to speak MongoDB Wire Protocol
Teach your PostgreSQL database how to speak MongoDB Wire Protocol

β€œIf it looks like MongoDB, swims like MongoDB, and quacks like MongoDB, then it probably is PostgreSQL.” πŸ™ƒ Discord | Online Demo | Intro Video | Quic

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. πŸ’‘ Looking for an async version? async-std https://github.c

CouchDB client-side library for the Rust programming language

Chill Chill is a client-side CouchDB library for the Rust programming language, available on crates.io. It targets Rust Stable. Chill's three chief de

An object-relational in-memory cache, supports queries with an SQL-like query language.

qlcache An object-relational in-memory cache, supports queries with an SQL-like query language. Warning This is a rather low-level library, and only p

CouchDB client library for the Rust programming language

CouchDB This project is reborn! As of its v0.6.0 release, the couchdb crate has new life as a toolkit instead of providing a full-blown client. In a n

rinflux is Rust based influx client implementation that have been inspired from influx other language implementation, developed with πŸ’–
rinflux is Rust based influx client implementation that have been inspired from influx other language implementation, developed with πŸ’–

Unofficial InfluxDB Driver for Rust This library is a work in progress. This means a feature you might need is not implemented yet or could be handled

RisingWave is a cloud-native streaming database that uses SQL as the interface language.

RisingWave is a cloud-native streaming database that uses SQL as the interface language. It is designed to reduce the complexity and cost of building real-time applications. RisingWave consumes streaming data, performs continuous queries, and updates results dynamically. As a database system, RisingWave maintains results inside its own storage and allows users to access data efficiently.

PRQL is a modern language for transforming data β€” a simpler and more powerful SQL

PRQL Pipelined Relational Query Language, pronounced "Prequel". PRQL is a modern language for transforming data β€” a simpler and more powerful SQL. Lik

Bind the Prisma ORM query engine to any programming language you like ❀️

Prisma Query Engine C API Bind the Prisma ORM query engine to any programming language you like ❀️ Features Rust bindings for the C API Static link li

Comments
  • benchmarks for plsci

    benchmarks for plsci

    I'm currently using https://github.com/pllua/pllua at the moment. Are there any benchmarks for plsci in comparison:

    ie: https://gist.github.com/xvaara/df0b802b86d2aa4f30b88a3fd6b69a14

    opened by zcaudate 1
  • Second invocation of `cargo pgx run pg13` after building libplsci fails with

    Second invocation of `cargo pgx run pg13` after building libplsci fails with "Symbol not found: _eval_string"

    The first time after building libplsci I can successfully run cargo pgx run:

    installing extension
         Copying control file to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci.control`
         Copying shared library to `/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so`
         Writing extension schema to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci--1.0.sql`
        Finished installing plsci
        Starting Postgres v13 on port 28813
        Re-using existing database plsci
    psql (13.0)
    Type "help" for help.
    
    plsci=# select * from plsci('(+ 1 2 3)');
     plsci
    -------
     6
    (1 row)
    
    plsci=# ^D\q
    

    However, the second time, I get:

    $ cargo pgx run pg13
        Stopping Postgres v13
    building extension with features `pg13`
    "cargo" "build" "--features" "pg13" "--no-default-features"
       Compiling plsci v0.0.0 (/Users/borkdude/Dropbox/dev/clojure/plsci)
        Finished dev [unoptimized + debuginfo] target(s) in 2.83s
    
    installing extension
         Copying control file to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci.control`
         Copying shared library to `/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so`
         Writing extension schema to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci--1.0.sql`
        Finished installing plsci
        Starting Postgres v13 on port 28813
        Re-using existing database plsci
    psql (13.0)
    Type "help" for help.
    
    plsci=# select * from plsci('(+ 1 2 3)');
    ERROR:  could not load library "/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so": dlopen(/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so, 10): Symbol not found: _eval_string
      Referenced from: /Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so
      Expected in: flat namespace
     in /Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so
    plsci=#
    
    opened by borkdude 2
  • Create procedural language handler

    Create procedural language handler

    @eeeebbbbrrrr said:

    next you need to make a procedural language handler. You're free to use my not-yet-released pl/rust as a starting point: https://github.com/zombodb/plrust

    opened by borkdude 2
Owner
Michiel Borkent
Clojure developer, author and maintainer of clj-kondo, babashka and sci.
Michiel Borkent
Native PostgreSQL driver for the Rust programming language

Rust-Postgres PostgreSQL support for Rust. postgres Documentation A native, synchronous PostgreSQL client. tokio-postgres Documentation A native, asyn

Steven Fackler 2.8k Jan 8, 2023
Materialize simplifies application development with streaming data. Incrementally-updated materialized views - in PostgreSQL and in real time. Materialize is powered by Timely Dataflow.

Materialize is a streaming database for real-time applications. Get started Check out our getting started guide. About Materialize lets you ask questi

Materialize, Inc. 4.7k Jan 8, 2023
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx ?? The Rust SQL Toolkit Install | Usage | Docs Built with ❀️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

launchbadge 7.6k Dec 31, 2022
A Rust crate for writing servers that speak PostgreSQL's wire protocol

Convergence A Rust crate for writing servers that speak PostgreSQL's wire protocol. Additionally, the experimental convergence-arrow crate enables con

ReservoirDB 63 Jan 2, 2023
A tool for automated migrations for PostgreSQL, SQLite and MySQL.

Models Models is an implementation for a SQL migration management tool. It supports PostgreSQL, MySQL, and SQLite. Quick Start install the CLI by runn

null 45 Nov 16, 2022
Zenith substitutes PostgreSQL storage layer and redistributes data across a cluster of nodes

Zenith substitutes PostgreSQL storage layer and redistributes data across a cluster of nodes

null 5.7k Jan 6, 2023
The Solana AccountsDb plugin for PostgreSQL database.

The solana-accountsdb-plugin-postgres crate implements a plugin storing account data to a PostgreSQL database to illustrate how a plugin can be develo

Lijun Wang 3 Jun 16, 2022
Rust library to parse, deparse and normalize SQL queries using the PostgreSQL query parser

This Rust library uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.

pganalyze 37 Dec 18, 2022
Generate type-checked Rust from your PostgreSQL.

Cornucopia Generate type checked Rust from your SQL Install | Example Cornucopia is a small CLI utility resting on postgres designed to facilitate Pos

null 206 Dec 25, 2022
Rust - Build a CRUD API with SQLX and PostgreSQL

In this article, you'll learn how to build a CRUD API in Rust using SQLX, Actix-web, and PostgreSQL. Learning how to build a CRUD API as a developer will equip you with valuable skills for building robust, maintainable, and scalable applications.

CODEVO 5 Feb 20, 2023