Add getIndex function
This commit is contained in:
parent
ae105e29b2
commit
3263706d57
5
index.js
5
index.js
@ -1,4 +1,4 @@
|
|||||||
// const sqlite3 = require('sqlite3').verbose(); // Пошли в пизду со своим ассинхроном, ублюдки!
|
// const sqlite3 = require('sqlite3').verbose(); // Пошли в пизду со своим асинхроном, ублюдки!
|
||||||
const sqlite3 = require('better-sqlite3');
|
const sqlite3 = require('better-sqlite3');
|
||||||
|
|
||||||
|
|
||||||
@ -42,6 +42,9 @@ class database {
|
|||||||
ToString(value) {
|
ToString(value) {
|
||||||
return typeof(value) === 'string' ? '\'' + value + '\'' : value;
|
return typeof(value) === 'string' ? '\'' + value + '\'' : value;
|
||||||
}
|
}
|
||||||
|
getIndex (table, indexColumn) {
|
||||||
|
return this.get(table).length;
|
||||||
|
}
|
||||||
execute(SQLRequest) {
|
execute(SQLRequest) {
|
||||||
try {
|
try {
|
||||||
return this.db.prepare(SQLRequest).all();
|
return this.db.prepare(SQLRequest).all();
|
||||||
|
Loading…
Reference in New Issue
Block a user