mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
21 lines
372 B
Crystal
21 lines
372 B
Crystal
|
module DB
|
||
|
# Acts as an entry point for database access.
|
||
|
# Offers a com
|
||
|
class Database
|
||
|
getter driver_class
|
||
|
getter options
|
||
|
|
||
|
def initialize(@driver_class, @options)
|
||
|
@driver = @driver_class.new(@options)
|
||
|
end
|
||
|
|
||
|
def prepare(query)
|
||
|
@driver.prepare(query)
|
||
|
end
|
||
|
|
||
|
def exec(query, *args)
|
||
|
prepare(query).exec(*args)
|
||
|
end
|
||
|
end
|
||
|
end
|