
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
@www778878net/mysql78
Advanced tools
http://www.778878.net/docs/#/koa78-mysql78/
use for nodejs ts
project
See API documentation for details
See API documentation for details
See API documentation for details
Mysql78
is a class that encapsulates MySQL database operations, providing a series of convenient methods to execute SQL queries, updates, and transaction operations.
The constructor accepts a configuration object containing the following properties:
host
: Database host address (default is '127.0.0.1')port
: Database port (default is 3306)max
: Maximum number of connections in the pool (default is 200)user
: Database username (default is 'root')password
: Database password (required)database
: Database name (required)isLog
: Whether to enable logging (default is false)isCount
: Whether to enable performance statistics (default is false)Creates commonly used system tables.
Executes a SELECT query and returns the results.
Executes an UPDATE operation and returns the number of affected rows.
Executes an INSERT operation and returns the inserted ID.
Executes transaction operations.
Executes a single transaction operation, requires manual connection management.
Gets a database connection.
Releases a database connection.
Adds a warning log.
Saves SQL execution logs.
import Mysql78 from "@www778878net/mysql78"; import UpInfo from "@www778878net/koa78-upinfo";
const config = { host: "localhost", port: 3306, user: "root", password: "password", database: "testdb", isLog: true, isCount: true };
const mysql78 = new Mysql78(config); const upInfo = new UpInfo(null).getGuest();
// Execute a query const result = await mysql78.doGet("SELECT * FROM users WHERE id = ?", [1], upInfo);
// Execute an update const affectedRows = await mysql78.doM("UPDATE users SET name = ? WHERE id = ?", ["John", 1], upInfo);
// Execute an insert const insertId = await mysql78.doMAdd("INSERT INTO users (name, email) VALUES (?, ?)", ["Alice", "alice@example.com"], upInfo);
// Execute a transaction const transactionResult = await mysql78.doT( ["UPDATE users SET balance = balance - ? WHERE id = ?", "UPDATE users SET balance = balance + ? WHERE id = ?"], [[100, 1], [100, 2]], ["Transfer out failed", "Transfer in failed"], "Transfer operation", [100, 1, 2], upInfo );
getConnection()
to get a connection, remember to use releaseConnection()
to release the connection.isLog
and isCount
options will affect performance, it is recommended to enable them only during debugging.doT
method instead of manually managing transactions.you can see test/
FAQs
nodejs koa78封装 上传类
The npm package @www778878net/mysql78 receives a total of 2 weekly downloads. As such, @www778878net/mysql78 popularity was classified as not popular.
We found that @www778878net/mysql78 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.