New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vertx/jdbc-client

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vertx/jdbc-client - npm Package Compare versions

Comparing version 3.9.4 to 4.0.0-CR1

enums.d.ts

471

index.d.ts

@@ -37,9 +37,15 @@ /*

/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
*/
querySingle(sql: string, handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
querySingleWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
*/
static createNonShared(vertx: Vertx, config: { [key: string]: any }) : JDBCClient;
querySingleWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;

@@ -62,1 +68,460 @@ /**

}
import { PropertyKind } from '@vertx/sql-client';
import { Row } from '@vertx/sql-client';
import { Pool } from '@vertx/sql-client';
import { JDBCConnectOptions } from './options';
import { PoolOptions } from '@vertx/sql-client/options';
/**
* JDBCPool is the interface that allows using the Sql Client API with plain JDBC.
*/
export abstract class JDBCPool extends Pool {
/**
* The property to be used to retrieve the generated keys
*/
static readonly GENERATED_KEYS : PropertyKind<Row>;
/**
* The property to be used to retrieve the output of the callable statement
*/
static readonly OUTPUT : PropertyKind<boolean>;
/**
* Create a JDBC pool which maintains its own data source.
*/
static pool(vertx: Vertx, connectOptions: JDBCConnectOptions, poolOptions: PoolOptions) : JDBCPool;
/**
* Create a JDBC pool which maintains its own data source.
*/
static pool(vertx: Vertx, config: { [key: string]: any }) : JDBCPool;
}
import { UpdateResult } from './options';
import { ResultSet } from './options';
/**
* A common asynchronous client interface for interacting with SQL compliant database
*/
export abstract class SQLClient implements SQLOperations {
/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
*/
querySingle(sql: string, handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
*/
querySingleWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Returns a connection that can be used to perform SQL operations on. It's important to remember
* to close the connection when you are done, so it is returned to the pool.
*/
getConnection(handler: ((res: AsyncResult<SQLConnection>) => void) | Handler<AsyncResult<SQLConnection>>) : SQLClient;
/**
* Close the client and release all resources.
* Call the handler when close is complete.
*/
close(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
/**
* Close the client
*/
close() : void;
/**
* Execute a single SQL statement, this method acquires a connection from the the pool and executes the SQL
* statement and returns it back after the execution.
*/
query(sql: string, handler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLClient;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStream(sql: string, handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLClient;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStreamWithParams(sql: string, params: any[], handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLClient;
/**
* Execute a single SQL prepared statement, this method acquires a connection from the the pool and executes the SQL
* prepared statement and returns it back after the execution.
*/
queryWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLClient;
/**
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
*/
update(sql: string, handler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : SQLClient;
/**
* Executes the given prepared statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement with the given parameters
*/
updateWithParams(sql: string, params: any[], handler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : SQLClient;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*/
call(sql: string, handler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLClient;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*
* The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
* takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
*
* <pre>
* params = [VALUE1, VALUE2, null]
* outputs = [null, null, "VARCHAR"]
* </pre>
*/
callWithParams(sql: string, params: any[], outputs: any[], handler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLClient;
}
import { SQLOptions } from './options';
import { TransactionIsolation } from './enums';
/**
* Represents a connection to a SQL database
*/
export abstract class SQLConnection implements SQLOperations {
/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
*/
querySingle(sql: string, handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
*/
querySingleWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Sets the desired options to be applied to the current connection when statements are executed.
*
* The options are not applied globally but applicable to the current connection. For example changing the transaction
* isolation level will only affect statements run on this connection and not future or current connections acquired
* from the connection pool.
*
* This method is not async in nature since the apply will only happen at the moment a query is run.
*/
setOptions(options: SQLOptions) : SQLConnection;
/**
* Sets the auto commit flag for this connection. True by default.
*/
setAutoCommit(autoCommit: boolean, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Executes the given SQL statement
*/
execute(sql: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query.
*/
query(sql: string, resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLConnection;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStream(sql: string, handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLConnection;
/**
* Executes the given SQL <code>SELECT</code> prepared statement which returns the results of the query.
*/
queryWithParams(sql: string, params: any[], resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLConnection;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStreamWithParams(sql: string, params: any[], handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLConnection;
/**
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
*/
update(sql: string, resultHandler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : SQLConnection;
/**
* Executes the given prepared statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement with the given parameters
*/
updateWithParams(sql: string, params: any[], resultHandler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : SQLConnection;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*/
call(sql: string, resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLConnection;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*
* The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
* takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
*
* <pre>
* params = [VALUE1, VALUE2, null]
* outputs = [null, null, "VARCHAR"]
* </pre>
*/
callWithParams(sql: string, params: any[], outputs: any[], resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLConnection;
/**
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
*/
close(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
/**
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
*/
close() : void;
/**
* Commits all changes made since the previous commit/rollback.
*/
commit(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Rolls back all changes made since the previous commit/rollback.
*/
rollback(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Sets a connection wide query timeout.
*
* It can be over written at any time and becomes active on the next query call.
*/
setQueryTimeout(timeoutInSeconds: number) : SQLConnection;
/**
* Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
*/
batch(sqlStatements: string[], handler: ((res: AsyncResult<number[]>) => void) | Handler<AsyncResult<number[]>>) : SQLConnection;
/**
* Batch a prepared statement with all entries from the args list. Each entry is a batch.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
*/
batchWithParams(sqlStatement: string, args: any[][], handler: ((res: AsyncResult<number[]>) => void) | Handler<AsyncResult<number[]>>) : SQLConnection;
/**
* Batch a callable statement with all entries from the args list. Each entry is a batch.
* The size of the lists inArgs and outArgs MUST be the equal.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
*/
batchCallableWithParams(sqlStatement: string, inArgs: any[][], outArgs: any[][], handler: ((res: AsyncResult<number[]>) => void) | Handler<AsyncResult<number[]>>) : SQLConnection;
/**
* Attempts to change the transaction isolation level for this Connection object to the one given.
*
* The constants defined in the interface Connection are the possible transaction isolation levels.
*/
setTransactionIsolation(isolation: TransactionIsolation, handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Attempts to return the transaction isolation level for this Connection object to the one given.
*/
getTransactionIsolation(handler: ((res: AsyncResult<TransactionIsolation>) => void) | Handler<AsyncResult<TransactionIsolation>>) : SQLConnection;
}
/**
* Represents a SQL query interface to a database
*/
export interface SQLOperations {
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query.
*/
query(sql: string, resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLOperations;
/**
* Executes the given SQL <code>SELECT</code> prepared statement which returns the results of the query.
*/
queryWithParams(sql: string, params: any[], resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLOperations;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStream(sql: string, handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLOperations;
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStreamWithParams(sql: string, params: any[], handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLOperations;
/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
*/
querySingle(sql: string, handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
*/
querySingleWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
*/
update(sql: string, resultHandler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : SQLOperations;
/**
* Executes the given prepared statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement with the given parameters
*/
updateWithParams(sql: string, params: any[], resultHandler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : SQLOperations;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*/
call(sql: string, resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLOperations;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*
* The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
* takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
*
* <pre>
* params = [VALUE1, VALUE2, null]
* outputs = [null, null, "VARCHAR"]
* </pre>
*/
callWithParams(sql: string, params: any[], outputs: any[], resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLOperations;
}
import { Pipe } from '@vertx/core';
import { WriteStream } from '@vertx/core';
import { ReadStream } from '@vertx/core';
import { Future } from '@vertx/core';
/**
* A ReadStream of Rows from the underlying RDBMS. This class follows the ReadStream semantics and will automatically
* close the underlying resources if all returned rows are returned. For cases where the results are ignored before the
* full processing of the returned rows is complete the close method **MUST** be called in order to release underlying
* resources.
*
* The interface is minimal in order to support all SQL clients not just JDBC.
*/
export abstract class SQLRowStream implements ReadStream<any[]> {
fetch(arg0: number) : ReadStream<any[]>;
pipe() : Pipe<any[]>;
pipeTo(dst: WriteStream<any[]>, handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
exceptionHandler(handler: ((res: Throwable) => void) | Handler<Throwable> | null | undefined) : SQLRowStream;
handler(handler: ((res: any[]) => void) | Handler<any[]> | null | undefined) : SQLRowStream;
pause() : SQLRowStream;
resume() : SQLRowStream;
endHandler(endHandler: ((res: void) => void) | Handler<void> | null | undefined) : SQLRowStream;
/**
* Will convert the column name to the json array index.
*/
column(name: string) : number;
/**
* Returns all column names available in the underlying resultset. One needs to carefully use this method since in
* contrast to the singular version it does not perform case insensitive lookups or takes alias in consideration on
* the column names.
*/
columns() : string[];
/**
* Event handler when a resultset is closed. This is useful to request for more results.
*/
resultSetClosedHandler(handler: ((res: void) => void) | Handler<void>) : SQLRowStream;
/**
* Request for more results if available
*/
moreResults() : void;
/**
* Closes the stream/underlying cursor(s). The actual close happens asynchronously.
*/
close() : void;
/**
* Closes the stream/underlying cursor(s). The actual close happens asynchronously.
*/
close(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
}
/**
* Tag if a parameter is of type OUT or INOUT.
*
* By default parameters are of type IN as they are provided by the user to the RDBMs engine. There are however cases
* where these must be tagged as OUT/INOUT when dealing with stored procedures/functions or complex statements.
*
* This interface allows marking the type of the param as required by the JDBC API.
*/
export abstract class SqlOutParam {
/**
* Factory for a OUT parameter of type <code>out</code>.
*/
static OUT(out: number) : SqlOutParam;
/**
* Factory for a OUT parameter of type <code>out</code>.
*/
static OUT(out: string) : SqlOutParam;
/**
* Factory for a OUT parameter of type <code>out</code>.
*/
static OUT(out: any) : SqlOutParam;
/**
* Factory for a INOUT parameter of type <code>out</code>.
*/
static INOUT(__in: any, out: number) : SqlOutParam;
/**
* Factory for a INOUT parameter of type <code>out</code>.
*/
static INOUT(__in: any, out: string) : SqlOutParam;
/**
* Factory for a INOUT parameter of type <code>out</code>.
*/
static INOUT(__in: any, out: any) : SqlOutParam;
/**
* Is this marker <code>IN</code>?
*/
in() : boolean;
/**
* Get the output type
*/
type() : number;
/**
* Get the input value
*/
value() : any;
}

10

index.js

@@ -20,6 +20,12 @@ /*

/**
* @typedef { import("es4x") } Java
* @typedef { import("@vertx/core") } Java
*/
module.exports = {
JDBCClient: Java.type('io.vertx.ext.jdbc.JDBCClient')
JDBCClient: Java.type('io.vertx.ext.jdbc.JDBCClient'),
JDBCPool: Java.type('io.vertx.jdbcclient.JDBCPool'),
SQLClient: Java.type('io.vertx.ext.sql.SQLClient'),
SQLConnection: Java.type('io.vertx.ext.sql.SQLConnection'),
SQLOperations: Java.type('io.vertx.ext.sql.SQLOperations'),
SQLRowStream: Java.type('io.vertx.ext.sql.SQLRowStream'),
SqlOutParam: Java.type('io.vertx.jdbcclient.SqlOutParam')
};

@@ -17,2 +17,4 @@ /*

export * from './enums.mjs';
export * from './options.mjs';
export * from './index.mjs';
{
"name" : "@vertx/jdbc-client",
"description" : "Generated Eclipse Vert.x bindings for 'vertx-jdbc-client'",
"version" : "3.9.4",
"version" : "4.0.0-CR1",
"license" : "Apache-2.0",

@@ -10,7 +10,7 @@ "public" : true,

"artifactId" : "vertx-jdbc-client",
"version" : "3.9.4"
"version" : "4.0.0.CR1"
},
"dependencies" : {
"@vertx/core" : "3.9.4",
"@vertx/sql-common" : "3.9.4"
"@vertx/core" : "4.0.0-CR1",
"@vertx/sql-client" : "4.0.0-CR1"
},

@@ -20,2 +20,8 @@ "main" : "index.js",

"types" : "index.d.ts",
"exports" : {
"." : "./index.mjs",
"./index" : "./index.mjs",
"./enum" : "./enum.mjs",
"./options" : "./options.mjs"
},
"sideEffects" : false,

@@ -22,0 +28,0 @@ "repository" : {

@@ -1,4 +0,4 @@

![npm (scoped)](https://img.shields.io/npm/v/@vertx/jdbc-client.svg)
![npm](https://img.shields.io/npm/l/@vertx/jdbc-client.svg)
![Security Status](https://snyk-widget.herokuapp.com/badge/npm/@vertx/jdbc-client.svg)
![npm (scoped)](https://img.shields.io/npm/v/@vertx/sql-common.svg)
![npm](https://img.shields.io/npm/l/@vertx/sql-common.svg)
![Security Status](https://snyk-widget.herokuapp.com/badge/npm/%40vertx%2Fsql-common/badge.svg)

@@ -9,5 +9,5 @@ Generated JavaScript bindings for Eclipse Vert.x.

* [API Docs](https://reactiverse.io/es4x/@vertx/jdbc-client)
* [Manual](https://reactiverse.io/es4x/manual/@vertx/jdbc-client)
* [NPM module](https://www.npmjs.com/package/@vertx/jdbc-client)
* [API Docs](https://reactiverse.io/es4x/@vertx/sql-common)
* [Manual](https://reactiverse.io/es4x/manual/@vertx/sql-common)
* [NPM module](https://www.npmjs.com/package/@vertx/sql-common)

@@ -20,3 +20,7 @@ ## Usage

// Base API
import * as API from '@vertx/jdbc-client';
import * as API from '@vertx/sql-common';
// Base ENUMs
import * as ENUMS from '@vertx/sql-common/enums';
// DataObject's
import * as OPTIONS from '@vertx/sql-common/options';

@@ -23,0 +27,0 @@ // refer to the API docs for specific help...

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc