/
lorkinor
/
trainee-task-orm
Обзор
Документация
Войти
/
lorkinor
/
trainee-task-orm
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/modules/db_connection.rb
22 строки
429 B
Vlad Borodaev
Temp. Finish at home
16 фев 2018, 15:57
16 фев 2018, 15:57
4b9193b
Код
Авторство
О чём код?
module DBConnection private def connect begin connection = PG.connect :dbname => 'crieera', :user => 'crieera', :password => '' rescue PG::Error => e puts e.message end connection end def disconnect(connection) connection.close if connection end def execute_query(string_with_query) connection = connect connection.exec string_with_query disconnect(connection) end end