Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

README.md

sql2lua

A lua library for transforming SQL queries into lua functions.

Installation

via luarocks

luarocks install sql2lua

Usage

local sql2lua = require "sql2lua"

local sql = [[
-- name: select_foo
select *
  from foo

-- name: select_bar
select *
  from bar
 where name = :name
]]

local queries = sql2lua(sql)

print(queries.select_foo())
-- Output: select * from foo

print(queries.select_bar({ name = "bar" }))
-- Output: select * from bar where name = 'bar'

About

Generate lua functions from SQL queries

Resources

Packages

No packages published

Languages

You can’t perform that action at this time.