sparklemotion / sparklemotion/sqlite3-ruby

Add incremental blob support

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Ruby
Stars
845
Forks
220
Avg merge
2d 17h
Merged PRs (30d)
3

Description

BLOB-reading/writing can be done apart from SQL-Queries.


EXAMPLE:

..

filename = "test.png"

stmt = db.prepare("insert into files (filename, data) values (:filename,:data)")
stmt.bind_param("filename", filename)
stmt.bind_zeroblob("data", File.size(filename)
stmt.execute

f = File.new(filename, "w")

blob = db.blob_open('main','files','data',db.last_insert_row_id,1)
result = blob.write(f.read)

..


The space of the BLOB MUST be reserved. This can be done inside a SQL-query to:

"insert into files (filename, data) values ('test.png', zeroblob(2442))"

Moved from RubyForge

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the bind_zeroblob, blob_open, and blob.write entry points but no implementation files or tests. Start by locating the existing Ruby SQLite binding code for these operations and compare it with SQLite's incremental BLOB API. Done means the shown reserve, open, read/write workflow is supported and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, sqlite
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.