Class: Arfi::SqlFunctionLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/arfi/sql_function_loader.rb

Overview

Arfi::SqlFunctionLoader is a class which loads user defined SQL functions into database.

Class Method Summary collapse

Class Method Details

.load!nil, void

Arfi::SqlFunctionLoader.load! -> (nil | void)

Loads user defined SQL functions into database.

Returns:

  • (nil)

    if there is no ‘db/functions` directory.

  • (void)

    if there is no errors.

Raises:



14
15
16
17
18
19
20
# File 'lib/arfi/sql_function_loader.rb', line 14

def load!
  return unless sql_files.any?
  raise Arfi::Errors::AdapterNotSupported if conn.adapter_name == 'SQLite'

  populate_db
  conn.close
end