Questions tagged [clsql]

A multi-platform SQL interface for Common Lisp.

A multi-platform SQL interface for Common Lisp.

CLSQL is a SQL database for Common Lisp interface maintained by Kevin M. Rosenberg. CLSQL uses the Universal Foreign Function Interface (UFFI) library for broad compatibility.

CLSQL is compatible with AllegroCL, Lispworks, SBCL, CMUCL, and OpenMCL. It has been tested with Microsoft Windows, Linux, Solaris, FreeBSD on a number of different CPU architectures.

Source: http://clsql.b9.com/

35 questions
2
votes
1 answer

SQLITE3 CLSQL multithreaded insert results in error

I want to use my sqlite3 database with multiple threads in parallel. I read that using connection pools makes the access threadsafe but I still get errors while inserting data. (make-thread #'(lambda() (dotimes (i 100) …
Sim
  • 4,199
  • 4
  • 39
  • 77
2
votes
1 answer

How to implement viewclass with foreign keys also used as keys

Assume I have SQL table definitions like this CREATE TABLE X ( id integer not null, value character varying, PRIMARY KEY (id) ); CREATE TABLE Y ( start integer not null, end integer not null, value character vartying, …
Sim
  • 4,199
  • 4
  • 39
  • 77
2
votes
1 answer

How to create sqlite3 database

I want to create a new sqlite3 database. Taking a look at the examples of clsql I found this scenario. Which implies that (ql:quickload "clsql") (ql:quickload "clsql-sqlite3") (uffi:def-function ("create_iso_8859_15_ci_collation" create-coll) …
Sim
  • 4,199
  • 4
  • 39
  • 77
2
votes
2 answers

Write sqlite3 in-memory database into file using clsql

As the question indicates. I created an in-memory database using ":memory:" and clsql:with-database to increase write/insert-query performance. But in the end I do want to have a permanent copy of the filled database on my hard drive. It should look…
Sim
  • 4,199
  • 4
  • 39
  • 77
2
votes
1 answer

How to use autoincrement primary keys with CL-SQL?

I am using CL-SQL with SQLite backend, and I can't quite get autoincremented primary keys to work. I declared a slot like (in def-view-class): ((id :accessor d-id :db-constraints :primary-key :type integer :db-type "INTEGER") But if I create the…
J S
  • 89
  • 3
2
votes
1 answer

On OS X, with SLIME, inferior lisp stopped when loading foreign libraries

I use Quicklisp to load systems, and I debug my code with Slime. Quicklisp loads many systems successfully except cl-postgresql. When evaluating (ql:quickload "clsql-postgresql") in slime, the inferior lisp exits. Slime prints Lisp connection closed…
Sherwood Wang
  • 685
  • 9
  • 19
1
vote
1 answer

Cryptic error message when loading clsql

I'm trying to access a database from within CLISP using clsql. Since I'm running ubuntu, I installed all the necessary packages using apt-get, and to load them, I included the following bit of code at the top of my source file: (asdf:operate…
Samuel Breese
  • 694
  • 10
  • 26
1
vote
1 answer

CLSQL on CentOS installation

I want to connect to MySQL from SBCL using CLSQL. I loaded CLSQL using quicklisp (ql:quickload 'clsql). However, when calling (clsql:connect '(...) :database-type :mysql), it said: Couldn't load foreign libraries "libmysqlclient", "libmysql".…
Luka Ramishvili
  • 889
  • 1
  • 11
  • 20
1
vote
1 answer

HTML from DB not injecting into hunchentoot route

I have many routes in my app that get information from a database. In one particular situation, I am getting HTML content from a database to render it with cl-who. I am not sure why the content from the DB will not render. The rest of the page works…
Vinn
  • 1,030
  • 5
  • 13
1
vote
1 answer

SBCL load error for clsql-mysql from quicklisp for version clsql-20110829

For SBCL 1.0.45, using quicklisp to load clsql-mysql, I get an error about "no symbol", which appears to cause the interface to fail to load. Specifically, the error is: [package clsql-mysql] file:…
blake
  • 11
  • 1
1
vote
1 answer

libsqlite3 issue: I am not able to use cl-sql

I am trying to use cl-sql for database access to sqlite3. But I am getting the error Couldn't load foreign libraries "libsqlite3", "sqlite3". (searched CLSQL-SYS:*FOREIGN-LIBRARY-SEARCH-PATHS*: (#P"/usr/lib/clsql/" #P"/usr/lib/")) The same is…
Sreekumar R
  • 573
  • 6
  • 24
1
vote
1 answer

clsql Connection Pool

clsql seems to support connection pooling, since the connect method has the :pool key, and the cliki makes note of it being thread-safe when using with-database. I can't find an example of this being used online and I'm really not sure I'm using it…
1
vote
0 answers

How to use clsql and data-table together

I fail to comprehend how to use data-table with CLSQL. CL-CSV repository README mentions that this is possible, but I would just really like an example. f.e. If I have a data-table generated from a CSV in *db*, how do I use CLSQL to query the…
chkhd
  • 13
  • 2
1
vote
1 answer

No permission for select on table in a trigger function

I got the database "bikini-atoll" created using this PostgreSQL code: CREATE TABLE TESTA ( name character varying NOT NULL, age integer NOT NULL, PRIMARY KEY(name) ); CREATE DOMAIN RANK AS character varying CHECK ( VALUE…
Sim
  • 4,199
  • 4
  • 39
  • 77
0
votes
1 answer

CLSQL: Locally enabling sql reader syntax

I am trying to use the trivial SELECT in CLSQL. I tried many permutations, as shown below: (clsql:select 'dept_name :from 'dept :where (= 'dept_id 1)) ;; Error ;; DEPT_ID is not of type NUMBER ;; though dept_id is of…
Sreekumar R
  • 573
  • 6
  • 24