Class: RDF::DataObjects::Adapters::Sqlite3

Inherits:
Object
  • Object
show all
Extended by:
Defaults
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-do-a92b866a7db7/lib/rdf/do/adapters/sqlite3.rb

Class Method Summary collapse

Methods included from Defaults

count_sql, delete_sql, each_graph_sql, each_object_sql, each_predicate_sql, each_sql, each_subject_sql, insert_sql, query

Class Method Details

.migrate?(do_repository, opts = {})

This method returns an undefined value.

Indempotently migrate this database

Parameters:



14
15
16
17
18
19
20
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-do-a92b866a7db7/lib/rdf/do/adapters/sqlite3.rb', line 14

def self.migrate?(do_repository, opts = {})
  do_repository.exec('CREATE TABLE IF NOT EXISTS quads (`subject` varchar(255), `predicate` varchar(255), `object` varchar(255), `context` varchar(255), UNIQUE (`subject`, `predicate`, `object`, `context`))')
  begin do_repository.exec('CREATE INDEX `quads_context_index` ON `quads` (`context`)') rescue nil end
  begin do_repository.exec('CREATE INDEX `quads_object_index` ON `quads` (`object`)') rescue nil end
  begin do_repository.exec('CREATE INDEX `quads_predicate_index` ON `quads` (`predicate`)') rescue nil end
  begin do_repository.exec('CREATE INDEX `quads_subject_index` ON `quads` (`subject`)') rescue nil end
end