sql
sql copied to clipboard
Embedding of some of SQL into Racket
Let's say we have a table that looks like this: ```sql CREATE TABLE media ( id SERIAL PRIMARY KEY, title text, artist text, album text ); ``` And want to...
Hi I found the field selection notation under the mysql dialect produces incorrect SQL statements. For example ```racket (parameterize ((current-sql-dialect 'mysql)) (sql-statement->string (select (.* user) #:from user))) ``` produces ```sql...
Hi, This code fails at runtime, when run against the db: (sql (with #:recursive ([(cte id name parent) (inner-join (union (select h.id h.name h.parent #:from (as heap h) #:where (and...
I tried to use `with` (for a CTE) but got an undefined error. Glancing at the commit history I see: - commit a58ca7b added `with` - commit fdba335 removed `with`...
`UNION` is currently not a statement but a `table-expr` - this means that the following expression fails. `(sql (union (select x #:from xs) ...))`. This isn't too much of an...
### What version of Racket are you using? v7.8 ### What program did you run? `(create-table #:temporary the_numbers #:columns [n integer #:not-null] [d (varchar 20)])` ### What should have happened?...
let's say I want to write code like this: ~~~racket (define id-range '(1 10)) (select id sd_id created_at updated_at #:from users #:where (between-and id ,@id-range)) ~~~ or like this: ~~~racket...
I use a bunch of custom domains in my application for validation and, because those domains get assigned custom type ids which this library doesn't (I think) support, I end...
I'd like to create a row in a table with an auto-incrementing primary key, retrieve the generated key, and read the value later. Some SQL variants allow specifying that an...
This package seems to provide two main pieces: 1. A SQL-engine-agnostic AST and the ability to execute statements written in this AST 2. A fancy and user-friendly macro-powered S-expression notation...