Socket
Socket
Sign inDemoInstall

node-firebird

Package Overview
Dependencies
1
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.6 to 0.9.7

217

lib/index.d.ts

@@ -7,4 +7,3 @@ // Type definitions for node-firebird

type DatabaseCallback = (err: any, db: Database) => void;
type TransactionCallback = (err: Options, transaction: Transaction) => void;
type TransactionCallback = (err: any, transaction: Transaction) => void;
type QueryCallback = (err: any, result: any[]) => void;

@@ -23,7 +22,9 @@ type SimpleCallback = (err: any) => void;

export interface Database {
detach(callback?: SimpleCallback): void;
transaction(isolation: Isolation, callback: TransactionCallback): void;
query(query: string, params: any[], callback: QueryCallback): void;
execute(query: string, params: any[], callback: QueryCallback): void;
sequentially(query: string, params: any[], rowCallback: SequentialCallback, callback: SimpleCallback): void;
detach(callback?: SimpleCallback): Database;
transaction(isolation: Isolation, callback: TransactionCallback): Database;
query(query: string, params: any[], callback: QueryCallback): Database;
execute(query: string, params: any[], callback: QueryCallback): Database;
sequentially(query: string, params: any[], rowCallback: SequentialCallback, callback: SimpleCallback, asArray?: boolean): Database;
drop(callback: SimpleCallback): void;
escape(value: any): string;
}

@@ -35,3 +36,3 @@

commit(callback?: SimpleCallback): void;
rollback(callback?: SimpleCallback): void;
rollback(callback?: SimpleCallback): void;
}

@@ -46,16 +47,198 @@

lowercase_keys?: boolean;
role?: string;
pageSize?: number;
role?: string;
pageSize?: number;
}
export interface SvcMgrOptions extends Options {
manager: true; // Attach to ServiceManager
}
export interface ConnectionPool {
get(callback: DatabaseCallback): void;
destroy(): void;
destroy(): void;
}
export function attach(options: Options, callback: DatabaseCallback): void;
export function escape(value: string): string;
export function create(options: Options, callback: DatabaseCallback): void;
export function attach(options: Options, callback: DatabaseCallback): void;
export function attach(options: SvcMgrOptions, callback: ServiceManagerCallback): void;
export function escape(value: any): string;
export function create(options: Options, callback: DatabaseCallback): void;
export function attachOrCreate(options: Options, callback: DatabaseCallback): void;
export function pool(max: number,options: Options, callback: DatabaseCallback): ConnectionPool;
}
export function pool(max: number, options: Options): ConnectionPool;
export function drop(options: Options, callback: SimpleCallback): void;
interface ReadableOptions {
optread?: 'byline' | 'buffer'; // default 'byline'
buffersize?: number; // default 'byline': 2048, 'buffer': 8192
timeout?: number;
}
export interface BackupOptions extends ReadableOptions {
database?: string;
files: string | { filename: string, sizefile: string }[];
factor?: number; // If backing up to a physical tape device, this switch lets you specify the tape's blocking factor
verbose?: boolean;
ignorechecksums?: boolean;
ignorelimbo?: boolean;
metadataonly?: boolean;
nogarbasecollect?: boolean;
olddescriptions?: boolean;
nontransportable?: boolean;
convert?: boolean;
expand?: boolean;
notriggers?: boolean;
}
export interface NBackupOptions extends ReadableOptions {
database?: string;
file: string;
level?: number; // nb day for incremental
notriggers?: boolean;
direct?: 'on' | 'off'; // default 'on'
}
export interface RestoreOptions extends ReadableOptions {
database?: string;
files: string | string[];
verbose?: boolean;
cachebuffers?: number; // default 2048, gbak -buffers
pagesize?: boolean; // default 4096
readonly?: boolean; // default false
deactivateindexes?: boolean; // default false
noshadow?: boolean; // default false
novalidity?: boolean; // default false
individualcommit?: boolean; // default true
replace?: boolean; // default false
create?: boolean; // default true
useallspace?: boolean; // default false
metadataonly?: boolean; // default false
fixfssdata?: string; // default null
fixfssmetadata?: string; // default null
}
export interface NRestoreOptions extends ReadableOptions {
database?: string;
files: string | string[];
}
export interface ValidateOptions extends ReadableOptions {
database?: string;
checkdb?: boolean;
ignorechecksums?: boolean;
killshadows?: boolean;
mend?: boolean;
validate?: boolean;
full?: boolean;
sweep?: boolean;
listlimbo?: boolean;
icu?: boolean;
}
export interface StatsOptions extends ReadableOptions {
database?: string;
record?: boolean;
nocreation?: boolean;
tables?: boolean;
pages?: boolean;
header?: boolean;
indexes?: boolean;
tablesystem?: boolean;
encryption?: boolean;
objects?: string; // space-separated list of object index,table,systemtable
}
interface UserInfo {
userid: number;
groupid: number;
username: string;
firstname: string;
middlename: string;
lastname: string
admin: number;
rolename?: string;
groupname?: string;
}
export interface ServerInfo {
result: number;
dbinfo?: { database: any[], nbattachment: number, nbdatabase: number };
fbconfig?: any;
svcversion?: number;
fbversion?: string;
fbimplementation?: string;
fbcapatibilities: string[];
pathsecuritydb?: string;
fbenv?: string;
fbenvlock?: string;
fbenvmsg?: string;
limbotrans?: number[];
fbusers?: UserInfo[]
}
export interface ServerInfoReq {
dbinfo?: boolean;
fbconfig?: boolean;
svcversion?: boolean;
fbversion?: boolean;
fbimplementation?: boolean;
fbcapatibilities?: boolean;
pathsecuritydb?: boolean;
fbenv?: boolean;
fbenvlock?: boolean;
fbenvmsg?: boolean;
limbotrans?: boolean;
}
export interface TraceOptions extends ReadableOptions {
configfile?: string; // startTrace uses it
tracename?: string; // startTrace uses it
traceid?: number; // suspendTrace, stopTrace, and resumeTrace use it
}
type ServiceManagerCallback = (err: any, svc: ServiceManager) => void;
type ReadableCallback = (err: any, reader: NodeJS.ReadableStream) => void;
type InfoCallback = (err: any, info: ServerInfo) => void;
type LineCallback = (err: any, data: { result: number, line: string }) => void;
export enum ShutdownMode { NORMAL = 0, MULTI = 1, SINGLE = 2, FULL = 3 }
export enum ShutdownKind { FORCED = 0, DENY_TRANSACTION = 1, DENY_ATTACHMENT = 2 }
export interface ServiceManager {
detach(callback?: SimpleCallback, force?: boolean): void;
backup(options: BackupOptions, callback: ReadableCallback): void;
nbackup(options: BackupOptions, callback: ReadableCallback): void;
restore(options: NRestoreOptions, callback: ReadableCallback): void;
nrestore(options, callback): void;
setDialect(db: string, dialect: 1 | 3, callback: ReadableCallback): void;
setSweepinterval(db: string, interval: number, callback): void; // gfix -h INTERVAL
setCachebuffer(db: string, nbpages, callback: ReadableCallback): void; // gfix -b NBPAGES
BringOnline(db: string, callback: ReadableCallback): void; // gfix -o
Shutdown(db: string, kind: ShutdownKind, delay: number, mode: ShutdownMode, callback: ReadableCallback): void; // server version >= 2.0
Shutdown(db: string, kind: ShutdownKind, delay: number, callback: ReadableCallback): void; // server version < 2.0
setShadow(db: string, val: boolean, callback: ReadableCallback): void;
setForcewrite(db: string, val: boolean, callback: ReadableCallback): void; // gfix -write
setReservespace(db: string, val: boolean, callback: ReadableCallback): void; // true: gfix -use reserve, false: gfix -use full
setReadonlyMode(db: string, callback: ReadableCallback): void; // gfix -mode read_only
setReadwriteMode(db: string, callback: ReadableCallback): void; // gfix -mode read_write
validate(options: ValidateOptions, callback: ReadableCallback): void; // gfix -validate
commit(db: string, transactid: number, callback: ReadableCallback): void; // gfix -commit
rollback(db: string, transactid: number, callback: ReadableCallback): void;
recover(db: string, transactid: number, callback: ReadableCallback): void;
getStats(options: StatsOptions, callback: ReadableCallback): void;
getLog(options: ReadableOptions, callback: ReadableCallback): void;
getUsers(username: string | null, callback: InfoCallback): void;
addUser(username: string, password: string, info: UserInfo, callback: ReadableCallback): void;
editUser(username: string, info: UserInfo, callback: ReadableCallback): void;
removeUser(username: string, rolename: string | null, callback: ReadableCallback): void;
getFbserverInfos(infos: ServerInfoReq, options: { buffersize?: number, timeout?: number }, callback: InfoCallback): void; // if infos is empty all options are asked to the service
startTrace(options: TraceOptions, callback: ReadableCallback): void;
suspendTrace(options: TraceOptions, callback: ReadableCallback): void;
resumeTrace(options: TraceOptions, callback: ReadableCallback): void;
stopTrace(options: TraceOptions, callback: ReadableCallback): void;
getTraceList(options: ReadableOptions, callback: ReadableCallback): void;
readline(options: ReadableOptions, callback: LineCallback): void;
readeof(options: ReadableOptions, callback: LineCallback): void;
hasRunningAction(options: ReadableOptions, callback: ReadableCallback): void;
readusers(options: ReadableOptions, callback: ReadableCallback): void;
readlimbo(options: ReadableOptions, callback: ReadableCallback): void;
}
}

2

package.json
{
"name": "node-firebird",
"version": "0.9.6",
"version": "0.9.7",
"description": "Pure JavaScript and Asynchronous Firebird client for Node.js.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -52,3 +52,3 @@ # Pure JavaScript and Asynchronous Firebird client for Node.js

- `Firebird.attachOrCreate(options, function(err, db))` attach or create database
- `Firebird.pool(max, options, function(err, db)) -> return {Object}` create a connection pooling
- `Firebird.pool(max, options) -> return {Object}` create a connection pooling

@@ -406,3 +406,3 @@ ## Connection types

```js
const options = {...}; // Classic configuration with manager = true
Firebird.attach(options, function(err, svc) {

@@ -422,4 +422,7 @@ if (err)

function(err, data) {
console.log(data);
});
data.on('data', line => console.log(line));
data.on('end', () => svc.detach());
}
);
});
```

@@ -430,3 +433,3 @@

```js
const config = {...}; // Clasic configuration with manager = true
const config = {...}; // Classic configuration with manager = true
const RESTORE_OPTS = {

@@ -433,0 +436,0 @@ database: 'database.fdb',

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc