Skip to content
This repository was archived by the owner on Aug 9, 2020. It is now read-only.

Latest commit

 

History

History
33 lines (18 loc) · 607 Bytes

README.md

File metadata and controls

33 lines (18 loc) · 607 Bytes

lucid_sql

Installation

Add the gem to your ‘Gemfile’:

gem 'lucid_sql'

Usage

Without Sequel gem

sql = LucidSQL::Repository.new('sql/*.sql')

sql.select_unpublished_products # sql/select_unpublished_products.sql

Interpolate trusted data for query reuse (see String#%).

sql.copy_from_stdin(table: 'products')

Does not support bind parameters.

With Sequel gem

sql = LucidSQL::SequelRepository.new('sql/*.sql')

Splat arguments are bind parameters (see Sequel.lit).

sql.copy_from('/path/to/copy_data/products', table: 'products')