Gathering detailed insights and metrics for mariadb-transact
Gathering detailed insights and metrics for mariadb-transact
Gathering detailed insights and metrics for mariadb-transact
Gathering detailed insights and metrics for mariadb-transact
sql-formatter
Format whitespace in a SQL query to make it more readable
nest-transact
This package give you a simplest possibility to use transactions with Nestjs
bravo-formatter
Format whitespace in a SQL query to make it more readable
cl-sql-formatter
Format whitespace in a SQL query to make it more readable
npm install mariadb-transact
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (59.62%)
CoffeeScript (40.38%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
44 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Feb 05, 2017
Latest Version
0.7.4
Package Id
mariadb-transact@0.7.4
Size
4.78 kB
NPM Version
3.10.10
Node Version
7.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
3
A transaction manager for the node.js MariaSQL module that uses promises. This module is essentially a convenience wrapper for node-mariasql with some extended functionality.
npm install mariadb-transact
CoffeeScript
TransactionManager = require "mariadb-transact"
sqlcfg =
user: "USER"
password: "PASSWORD"
host: "HOST"
db: "DATABASE"
metadata: true
transact = new TransactionManager(sqlcfg)
transact.init().then ->
transact.basic().then (sql) ->
sql.fetchArray("SHOW DATABASES")
.then (res) ->
console.log res
.then ->
transact.begin()
.then (sql) ->
sql.command("DELETE FROM mytable WHERE id=3")
.then (res) ->
console.log res
sql.commit()
.then ->
transact.close()
.catch (err) ->
console.error err.stack
JavaScript
var TransactionManager = require("mariadb-transact");
var sqlcfg = {
user: "USER",
password: "PASSWORD",
host: "HOST",
db: "DATABASE",
metadata: true
};
var transact = new TransactionManager(sqlcfg);
transact.init().then(function() {
return transact.basic().then(function(sql) {
return sql.fetchArray("SHOW DATABASES").then(function(res) {
return console.log(res);
});
}).then(function() {
return transact.begin();
}).then(function(sql) {
return sql.command("DELETE FROM mytable WHERE id=3").then(function(res) {
console.log(res);
return sql.commit();
}).then(function() {
return transact.close();
});
});
})["catch"](function(err) {
return console.error(err.stack);
});
require('mariadb-transact')
returns a TransactionManager object.
error(< Error >err) - An error occurred.
init() - The manager has been initialized.
contructor(< object >config) - Create and return a new TransactionManager instance. The config object is equivalent to the Client config object in the node-mariasql library, but takes an additional parameter and extends on the metadata parameter:
metadata - < boolean > - Automatically convert result data into appropriate types. Default: false
poolsize - < integer > - Size of the connection pool. Default: 20
init() - < Promise >() - Initializes the database connection and returns a promise that fulfills when it is connected.
basic() - < Promise>(< Client >client) - Returns a promise that fulfills with a non-transaction-safe Client object.
begin() - < Promise>(< Client >client) - Returns a promise that fulfills with a transaction-safe Client object from the connection pool. Transaction-safe Client objects must always be completed using their commit or rollback method, otherwise they will not complete or return to the pool.
close() - < Promise >() - Closes connection and returns a promise that fulfills when complete.
command(< string >query, < object >params) - < Promise >(< object >result) - Executes SQL query, returns promise that fulfills with a result object containing the following elements:
affectedRows - < integer > - Number of rows affected by the command.
insertId - < integer > - Last auto-increment ID of insert command.
numRows - < integer > - Number of returned rows.
commit() - < Promise >() - Commits a transaction. Promise fulfulls when done.
fetchArray(< string >sql, < object >params) - < Promise >(< Array >results) - Executes SQL query, returns promise that fulfills with a result array.
fetchOne(< string >sql, < object >params) - < Promise >(< object >result) - Executes SQL query, returns promise that fulfills with a single result object. This command always returns the first result row of the query.
rollback() - < Promise >() - Rolls back a transaction. Promise fulfulls when done.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More