Comandante/SQLite

An add-on for Comandante to simplify working with sqlite.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  comandante-sqlite:
    github: tghaleb/comandante-sqlite
  1. Run shards install

Usage

require "comandante-sqlite"

This is actually a wrapper around sqlite.

To setup a database,

db = SQLite.new(path_to_db)
db.create_table(TBL_SQL)
db.close

class Comandante::SQLite
inherits Reference

Constructors

.new(file = "")

Will automatically close db on exit or finalize.

View source

Methods

#close

View source

#create_table(tbl_sql)

Creates a table from given SQL

View source

#file

View source

#finalize

View source

#reset_db(file = "")

Will close current db and open a new with given file name

View source