<commit_before>/*
	turn web sql api into something more nodish and nicer
*/
var _ = require('lodash')
var QueryCommand = require('./QueryCommand.js')
var util = require('util')

module.exports = Tx

function Tx(db) {
	if (!(this instanceof Tx)) return new Tx(db)

	this._db = db
	this._queryCommands = []

	// make it easier to override in subclasses
	this._execTransaction = _.bind(db.transaction, db)

	this._executed = false
}

/*
	chain one or more queries in the transaction
*/
Tx.prototype.query = function (query, args) {

	// transform to array if its a arguments object
	if (!util.isArray(args)) {
		args = this.params(args)<commit_msg>do no transform undefined args<commit_after>/*
	turn web sql api into something more nodish and nicer
*/
var _ = require('lodash')
var QueryCommand = require('./QueryCommand.js')
var util = require('util')

module.exports = Tx

function Tx(db) {
	if (!(this instanceof Tx)) return new Tx(db)

	this._db = db
	this._queryCommands = []

	// make it easier to override in subclasses
	this._execTransaction = _.bind(db.transaction, db)

	this._executed = false
}

/*
	chain one or more queries in the transaction
*/
Tx.prototype.query = function (query, args) {

	// transform to array if its a arguments object
	if (args && !util.isArray(args)) {
		args = this.params(args)
{'fraction_non_alphanumeric': 0.12167300380228137, 'fraction_numerical': 0.0, 'mean_word_length': 3.9288389513108615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5337806', 'n_tokens_mistral': 420, 'n_tokens_neox': 408, 'n_words': 142}