WAutoSequelize

WAutoSequelize

new WAutoSequelize(optopt) → {Promise}

Description:
  • 由指定資料庫生成各表的models資料

Source:
Parameters:
Name Type Attributes Default Description
opt Object <optional>
{}

輸入設定物件,預設{}

Properties
Name Type Attributes Default Description
database String <optional>
null

輸入資料庫名稱字串,預設null

username String <optional>
null

輸入使用者名稱字串,預設null

password String <optional>
null

輸入密碼字串,預設null

dialect String <optional>
null

輸入資料庫種類字串,預設null,可選'mysql', 'mariadb', 'sqlite', 'postgres', 'mssql'

directory String <optional>
'./models'

輸入models儲存的資料夾名稱字串,預設'./models'

host String <optional>
'localhost'

輸入連線主機host位址字串,預設'localhost'

port Integer <optional>
null

輸入連線主機port整數,預設null

storage String <optional>
''

輸入sqlite檔案位置字串,預設''

Returns:

回傳Promise,resolve回傳產生的models資料,reject回傳錯誤訊息

Type
Promise