aboutsummaryrefslogtreecommitdiff
path: root/src/guff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-05 19:01:25 -0500
committerPaul Duncan <pabs@pablotron.org>2016-03-05 19:01:25 -0500
commitdf8dbe48e73581599f73c365e173fb017f0919c3 (patch)
tree9bf3ed98ed81e2d4a4507e5a9d90a4ca754549c5 /src/guff
parentceca7411df9b891a1534f0e90540d23e0af74f25 (diff)
downloadold-guff-df8dbe48e73581599f73c365e173fb017f0919c3.tar.bz2
old-guff-df8dbe48e73581599f73c365e173fb017f0919c3.zip
refactor model and db
Diffstat (limited to 'src/guff')
-rw-r--r--src/guff/database.cr7
-rw-r--r--src/guff/model.cr11
2 files changed, 18 insertions, 0 deletions
diff --git a/src/guff/database.cr b/src/guff/database.cr
new file mode 100644
index 0000000..de11eb2
--- /dev/null
+++ b/src/guff/database.cr
@@ -0,0 +1,7 @@
+require "sqlite3"
+
+module Guff
+ class Database < ::SQLite3::Database
+ # TODO (add table_exists?)
+ end
+end
diff --git a/src/guff/model.cr b/src/guff/model.cr
new file mode 100644
index 0000000..370229c
--- /dev/null
+++ b/src/guff/model.cr
@@ -0,0 +1,11 @@
+module Guff
+ class Model
+ getter :db
+
+ def initialize(@config : Config)
+ # create site database
+ db_path = "%s/site.db" % [config["data"]]
+ @db = Database.new(db_path)
+ end
+ end
+end