lispEn 2022-10-13 11:27:17

Run PostgreSQL queries with Common Lisp

SQL queries and S-SQL

S-SQL provides a lispy syntax for SQL queries, and knows how to convert various lisp types to their textual SQL representation.

S-Expression = symbolic expression.

S-SQL = symbolic expression Structured Query Language.

An example:

(query (:select '* :from 'students))

SQL queries = Structured Query Language.

An example:

my_database=# select * from students;

Postmodern is a Common Lisp library for interacting with PostgreSQL databases.
see for more information:

First we are going to create the user and  database into postgresql:

create user my_user with password 'ultra-secret-password';


postgres=# create database my_database owner my_user ;


Now we need to load the library by quicklisp:

(ql:quickload "postmodern")
To load "postmodern":
 Load 1 ASDF system:
; Loading "postmodern"

;; Use the package
(in-package :postmodern)

You can get the example

Test the connection

Create the table

Select SQL

Update SQL

#lisp #postgresql #postmodern


#postgresql #postmodern

También te podría interesar
lisp codeEn 2022-07-13 13:12:00
lispEn 2019-09-17 20:18:42
lispEn 2022-11-01 13:51:41
Common lisp is great because of who it is designed by...
lispmxEn 2017-12-26 12:17:40
lispEn 2022-12-06 15:05:07
In this post we will show the Common Lisp version and implementation you're using, from the REPL.