Class | Termtter::Storage::SQLite3
In: | lib/plugins/storage/sqlite3.rb
Parent: | Object

### Methods

create_table find_id find_text find_user find_user_id insert name new size update update_user

### Constants

CREATE_TABLE | = | <<-SQL CREATE TABLE IF NOT EXISTS user ( id int NOT NULL, screen_name text, PRIMARY KEY (id) ); CREATE TABLE IF NOT EXISTS post ( post_id int NOT NULL, -- twitter側のpostのid created_at int, -- 日付(RubyでUNIX時間に変換) in_reply_to_status_id int, -- あったほうがよいらしい in_reply_to_user_id int, -- あったほうがよいらしい post_text text, user_id int NOT NULL, PRIMARY KEY (post_id) ); SQL
FIND_USER_ID | = | <<-EOS select id, screen_name from user where id = ? EOS
FIND_ID | = | <<-EOS select created_at, screen_name, post_text, in_reply_to_status_id, post_id, user_id from post inner join user on post.user_id = user.id where post_id = ? EOS
FIND | = | <<-EOS select created_at, screen_name, post_text, in_reply_to_status_id, post_id, user_id from post inner join user on post.user_id = user.id where post_text like '%' || ? || '%' EOS
FIND_USER | = | <<-EOS select created_at, screen_name, post_text, in_reply_to_status_id, post_id, user_id from post inner join user on post.user_id = user.id where EOS

### Public Class methods

new(file = Termtter::CONF_DIR + '/storage.db')

### Public Instance methods

create_table()
find_id(id)
find_text(text = '')
find_user(user = "")
find_user_id(user_id)
insert(status)
name()
size()
update(status)
update_user(user_id, screen_name)

[Validate]