Remove deprecated calls for the Sequel ORM, add compatibility for Sequel 5. v0.3.0
authorMahlon E. Smith <mahlon@laika.com>
Wed, 17 Jan 2018 13:33:12 -0800
changeset 13 686fbfe638bd
parent 12 2f9a295bdba7
child 14 df6b0c7491b8
Remove deprecated calls for the Sequel ORM, add compatibility for Sequel 5.
History.md
Rakefile
lib/thingfish/metastore/pggraph.rb
--- a/History.md	Mon Jan 16 12:48:37 2017 -0800
+++ b/History.md	Wed Jan 17 13:33:12 2018 -0800
@@ -1,3 +1,8 @@
+## v0.2.0 [2018-01-17] Mahlon E. Smith <mahlon@martini.nu>
+
+Update for Sequel 5.x.
+
+
 ## v0.2.0 [2017-01-16] Mahlon E. Smith <mahlon@martini.nu>
 
 Update for Configurability 3.x.
--- a/Rakefile	Mon Jan 16 12:48:37 2017 -0800
+++ b/Rakefile	Wed Jan 17 13:33:12 2018 -0800
@@ -50,10 +50,10 @@
 	EOF
 	s.required_ruby_version = '>= 2.3'
 
-	s.add_dependency 'thingfish', '~> 0.6'
+	s.add_dependency 'thingfish', '~> 0.7'
 	s.add_dependency 'loggability', '~> 0.11'
-	s.add_dependency 'sequel', '~> 4.35'
-	s.add_dependency 'pg', '~> 0.19'
+	s.add_dependency 'sequel', '~> 5.4'
+	s.add_dependency 'pg', '~> 1.0'
 end
 
 Gem::PackageTask.new( spec ) do |pkg|
--- a/lib/thingfish/metastore/pggraph.rb	Mon Jan 16 12:48:37 2017 -0800
+++ b/lib/thingfish/metastore/pggraph.rb	Wed Jan 17 13:33:12 2018 -0800
@@ -24,7 +24,7 @@
 
 
 	# Package version
-	VERSION = '0.2.0'
+	VERSION = '0.3.0'
 
 	# Version control revision
 	REVISION = %q$Revision$
@@ -59,12 +59,13 @@
 	### Set up the metastore database and migrate to the latest version.
 	def self::setup_database
 		Sequel.extension :pg_json_ops
+		Sequel.split_symbols = true
+		Sequel::Model.require_valid_table = false
 
 		self.db = Sequel.connect( self.uri )
 		self.db.logger = Loggability[ Thingfish::Metastore::PgGraph ]
 		self.db.extension :pg_streaming
 		self.db.stream_all_queries = true
-		self.db.optimize_model_load = true
 		self.db.sql_log_level = :debug
 		self.db.extension( :pg_json )
 		self.db.log_warn_duration = self.slow_query_seconds
@@ -103,8 +104,9 @@
 	def initialize( * ) # :notnew:
 		require 'thingfish/metastore/pggraph/node'
 		require 'thingfish/metastore/pggraph/edge'
-		Thingfish::Metastore::PgGraph::Node.db = self.class.db
-		Thingfish::Metastore::PgGraph::Edge.db = self.class.db
+
+		Thingfish::Metastore::PgGraph::Node.dataset = self.class.db[ :nodes ]
+		Thingfish::Metastore::PgGraph::Edge.dataset = self.class.db[ :edges ]
 		@model = Thingfish::Metastore::PgGraph::Node
 	end