aboutsummaryrefslogtreecommitdiff
path: root/lib/osugiru/database.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/osugiru/database.rb')
-rw-r--r--lib/osugiru/database.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/osugiru/database.rb b/lib/osugiru/database.rb
new file mode 100644
index 0000000..d014c94
--- /dev/null
+++ b/lib/osugiru/database.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Osugiru
+ class Database
+ attr_reader :db
+
+ def initialize(path:)
+ @db = ::Notmuch::Database.new(path)
+ end
+
+ def query(query)
+ db.query(query)
+ end
+
+ def search_messages(query)
+ query(query).search_messages
+ end
+ end
+end