   @method init
   @param {object} Configuration for the Database
   ###
-  init = (db_config) ->
-    CONFIG = lng.Core.mix(CONFIG, db_config)
-    db = openDatabase(CONFIG.name, CONFIG.version, CONFIG.name, CONFIG.size)
+  init = (name, version, size, schema) ->
+    db = openDatabase name, version, name, size
     if db
-      _createSchema()
+      schema_len = schema.length
+      return unless schema_len
+      i = 0
+      while i < schema_len
+        current = schema[i]
+        _regenerateTable current
+        _createTable current.name, current.fields
+        i++
+
     else
-      throw new Error(ERROR.DATABASE)
+      throw new Error "[ERROR] Device.DB: DB unnecesible"
 
 
   ###

    execute "INSERT INTO " + table + " (" + fields + ") VALUES (" + values + ")"

  _throwError = (transaction, error) ->
    throw new Error(ERROR.DATABASE_TRANSACTION + error.code + ": " + error.message + " \n Executed query: " + transaction.executedQuery)

  init: init
  select: select

###

Device.DB = do(dvc = Device) ->
  db = null

  ###
