# Migration Guide

This guide will be quite short, I tried my best to make most of quick.db 9.0.0 backwards compatible with other versions

## Initialization

The way to initialize quick.db has been changed.

```javascript
// Quick.db before
const db = require('quick.db');

// Now
const { QuickDB } = require('quick.db');
const db = new QuickDB();
```

## Table

The table function now doesn't use the new keyword

```javascript
// Quick.db before
const table = new db.table("my_table");

// Now
const table = db.table("my_table");
```

## Subtract

This is the only method that changed.\
It has been renamed to `sub` to keep the naming convention of the `add` method

```javascript
// Quick.db before
await db.subtract("mykey", 10);

// Now
await db.sub("mykey", 10);
```

## Async/Await

Now quick.db uses async and await for all of it's method

```javascript
// Quick.db before
db.add("mykey", 10);

// Now
await db.add("mykey", 10);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://plexidev.gitbook.io/quickdb/overview/migration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
