### Hierarchy

- NanoSQLBackend

### Implemented by

- _NanoSQLDB
- _NanoSQLNullStore

## Index

### Methods

- _connect
- _exec
- _extend
- _transaction

## Methods

### _connect

- _connect(connectArgs: DBConnect): void

- - Defined in index.ts:1466

  Inilitize the database for use, async so you can connect to remote stuff as needed.

  This is called by NanoSQL once to the DB driver once the developer calls "connect()".

  Models, Views, Actions, and added Filters are all sent in at once. Once the "onSuccess" function is called the database should be ready to use.

  The "preCustom" var contains an array of calls made to the "custom" method before connect() was called. All subsequent custom() calls will pass directly to the database "custom()" method.

  memberof

    NanoSQLBackend

  #### Parameters

  - ##### connectArgs: DBConnect

  #### Returns void

### _exec

- _exec(execArgs: DBExec): void

- - Defined in index.ts:1490

  Executes a specific query on the database with a specific table

  This is called on "exec()" and all the query parameters are passed in as an array of Objects containing the query parameters.

  The syntax is pretty straightforward, for example a query like this: NanoSQL("users").query("select").exec() will turn into this:

      [{type:'select',args:undefined}]

  Let's say the person using the system gets crazy and does NanoSQL("users").query("select",['username']).orderBy({name:'desc'}).exec(); Then you get this:

      [{type:'select',args:['username']},{type:"orderBy",args:{name:'desc}}]

  With that information and the table name you can create the query as needed, then return it through the onSuccess function.

  memberof

    NanoSQLBackend

  #### Parameters

  - ##### execArgs: DBExec

  #### Returns void

### Optional _extend

- _extend(instance: NanoSQLInstance, ...args: Array<any>): any

- - Defined in index.ts:1503

  Optional extension for the database. The extend method for NanoSQL is just a passthrough to this method. An entirely different and new API can be built around this.

  memberof

    NanoSQLBackend

  #### Parameters

  - ##### instance: NanoSQLInstance

  - ##### Rest ...args: Array<any>

  #### Returns any

### _transaction

- _transaction(type: "start" | "end", id: number): Promise<any[]>

- - Defined in index.ts:1512

  Let the database driver know it needs to start or end a transaction

  memberof

    NanoSQLBackend

  #### Parameters

  - ##### type: "start" | "end"

  - ##### id: number

  #### Returns Promise<any[]>

Generated using TypeDoc