Skip to main content

DAO mode reading and writing database

Function definition

The function uses DAO design pattern, not [ActiveRecord design pattern](https://www.martinfowler.com/eaaCatalog/ activeRecord.html).

Example

The following code is an example of inserting a piece of data into the account table of the passport library:

account = {
"username": "luwak_fans",
"email": "luwak_fans@api.tech"
}

luwak.dao("passport.account.add", account)

passport.account.add where:

  • passport is the database name
  • account is the table name
  • add is the operation type