open-index/open-npm huggingface dataset:
npm package: @letsscrapedata/db
Description: Database package
Author: LetsScrapeData
Latest version: 0.8.0

<div align="center">
  <div>
    <a href="https://www.LetsScrapeData.com" style="text-decoration: none" target="_blank">
      <img src="https://www.letsscrapedata.com/assets/logo.svg" width="160" alt="LetsScrapeData">
    </a>
  </div>
  <!-- <div>This is part of LetsScrapeData <a href="https://www.npmjs.com/~letsscrapedata"> web scraping suites </a>.</div> -->
  <div>You can use a free <a href="https://www.LetsScrapeData.com">LetsScrapeData App</a> if you want to scrape web data without programming.</div>
  <br/>
</div>

<font size=4>Please get help and discuss how to scrape a website on the [discord server](https://discord.gg/46atZ8kPVb), which can respond quickly. It is better to submit issues on [github](https://github.com/LetsScrapeData/db) for better tracking.</font>

## Features
This package is mainly used by [LetsScrapeData App](https://www.LetsScrapeData.com) to access different databases using a unified interface. Compared to comprehensive [knex](https://www.npmjs.com/package/knex), this package is simple to use and more suitable for developers who like to use SQL statements and JSON objects directly.
* Supported databases: mysql, sqlite (more to come)
* DQL: select, selectColumns
* DML: delete, insert, insertObjects, update, updateByObject
* DDL: execOneDdlSql, execSqlScript
* transanction: begin, commit, rollback
* sqlite: support "concurrent" transactions by executing transactions one by one
* Automatic camelize and decamel conversion
* logging: when a transaction exceeds the set time, print the log

## Install
```sh
npm install @letsscrapedata/db
```

## Examples
```typescript
import { Db, MysqlConnectCfg } from "@letsscrapedata/db";

const connCfg: MysqlConnectCfg = {
  dbType: "mysql",
  host: "127.0.0.1",
  user: "username",
  password: "password",
  database: "db1"
};

const db = new Db("mysql");
await db.connect(connCfg);

const accounts= [ {userName: "Louis", age: 34, gender: "male"} ];

await db.insertObjects("account", accounts);
// the same
await db.insert("INSERT INTO account(user_name, age, gender) VALUES(?, ?, ?)", ["Louis", 34, "male"]);

let records = await db.select("SELECT user_name AS userName, gender FROM account WHERE age > ?", [30])
// the same(camelCaseFlag: default true)
records = await db.selectColumns(["user_name", "gender"], "account", "age > ?", [30]);

await db.close();
```
npm package: @letsscrapedata/utils
Description: This package is mainly used by LetsScrapeData App
Author: LetsScrapeData
Latest version: 0.8.0

<div align="center">
  <div>
    <a href="https://www.LetsScrapeData.com" style="text-decoration: none" target="_blank">
      <img src="https://www.letsscrapedata.com/assets/logo.svg" width="160" alt="LetsScrapeData">
    </a>
  </div>
  <!-- <div>This is part of LetsScrapeData <a href="https://www.npmjs.com/~letsscrapedata"> web scraping suites </a>.</div> -->
  <div>You can use a free <a href="https://www.LetsScrapeData.com">LetsScrapeData App</a> if you want to scrape web data without programming.</div>
  <br/>
</div>

<font size=4>Please get help and discuss how to scrape a website on the [discord server](https://discord.gg/46atZ8kPVb), which can respond quickly. It is better to submit issues on [github](https://github.com/LetsScrapeData/utils) for better tracking.</font>

## Features
This package is mainly used by [LetsScrapeData App](https://www.LetsScrapeData.com).

## Install
```sh
npm install @letsscrapedata/utils
```