AN SQL interface for Common Lisp

  • Authors:
  • Alan S. Gunderson

  • Affiliations:
  • -

  • Venue:
  • ACM SIGPLAN Lisp Pointers
  • Year:
  • 1991

Quantified Score

Hi-index 0.03

Visualization

Abstract

Access to persistent database storage from Common Lisp applications is an increasingly frequent requirement. This paper discusses a software module that allows a Common Lisp program to access a relational database management system. Database queries are expressed as SQL statements. In Common Lisp, the SQL query is represented as a string, which allows sequence functions to be used to construct the query. Through a foreign function interface, the SQL query is passed from Lisp to a C component. The C component contains embedded database statements to utilize the dynamic SQL facility provided by the database management system. The database result table is returned to Lisp. Functions are provided to convert the returned data into a list of structures. Each structure corresponds to one row in the database result table. Structure accessor functions allow each individual attribute (field) in the structure representation of a row in the result table to be obtained.