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

@vertx/sql-common

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vertx/sql-common - npm Package Compare versions

Comparing version 3.5.4 to 3.8.4

enums.mjs

56

enums.d.ts

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

export enum FetchDirection { FORWARD, REVERSE, UNKNOWN }
export enum ResultSetConcurrency { READ_ONLY, UPDATABLE }
export enum ResultSetType { FORWARD_ONLY, SCROLL_INSENSITIVE, SCROLL_SENSITIVE }
export enum TransactionIsolation { READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE, NONE }
/*
* Copyright 2019 ES4X
*
* ES4X licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Represents the fetch direction hint
*/
export enum FetchDirection {
FORWARD,
REVERSE,
UNKNOWN
}
/**
* Represents the resultset concurrency hint
*/
export enum ResultSetConcurrency {
READ_ONLY,
UPDATABLE
}
/**
* Represents the resultset type hint
*/
export enum ResultSetType {
FORWARD_ONLY,
SCROLL_INSENSITIVE,
SCROLL_SENSITIVE
}
/**
* Represents a Transaction Isolation Level
*/
export enum TransactionIsolation {
READ_UNCOMMITTED,
READ_COMMITTED,
REPEATABLE_READ,
SERIALIZABLE,
NONE
}

@@ -1,2 +0,18 @@

/// <reference types="@vertx/sql/enums" />
/*
* Copyright 2019 ES4X
*
* ES4X licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/// <reference types="@vertx/sql-common/enums" />
module.exports = {

@@ -3,0 +19,0 @@ FetchDirection: Java.type('io.vertx.ext.sql.FetchDirection'),

561

index.d.ts

@@ -1,49 +0,54 @@

import { AsyncResult } from '@vertx/core';
/*
* Copyright 2019 ES4X
*
* ES4X licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
import { Handler, AsyncResult } from '@vertx/core';
import { UpdateResult } from './options';
import { ResultSet } from './options';
export class SQLClient {
/**
* 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.
* @param sql the statement to execute
* @param handler the result handler
* @return self
*
* 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: (result: AsyncResult<any[]>) => void) : SQLOperations;
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.
* @param sql the statement to execute
* @param arguments the arguments
* @param handler the result handler
* @return self
*
* 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: (result: AsyncResult<any[]>) => void) : SQLOperations;
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.
* @param handler the handler which is called when the <code>JdbcConnection</code> object is ready for use.
*
* 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: (result: AsyncResult<SQLConnection>) => void) : SQLClient;
getConnection(handler: ((res: AsyncResult<SQLConnection>) => void) | Handler<AsyncResult<SQLConnection>>) : SQLClient;
/**
* Close the client and release all resources.
* Call the handler when close is complete.
* @param handler the handler that will be called when close is complete
*
* Close the client and release all resources.
* Call the handler when close is complete.
*/
close(handler: (result: AsyncResult<void>) => void) : void;
close(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
/**
* Close the client
*
* Close the client
*/

@@ -53,73 +58,52 @@ 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.
* @param sql the statement to execute
* @param handler the result handler
* @return self
*
* 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: (result: AsyncResult<ResultSet>) => void) : SQLClient;
query(sql: string, handler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : 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.
* @param sql the statement to execute
* @param arguments the arguments to the statement
* @param handler the result handler
* @return self
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryWithParams(sql: string, arguments: any[], handler: (result: AsyncResult<ResultSet>) => void) : SQLClient;
queryStream(sql: string, handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLClient;
/**
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
* @param sql the SQL to execute. For example <code>INSERT INTO table ...</code>
* @param handler the handler which is called once the operation completes.
* @see java.sql.Statement#executeUpdate(String)
* @see java.sql.PreparedStatement#executeUpdate(String)
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
update(sql: string, handler: (result: AsyncResult<UpdateResult>) => void) : SQLClient;
queryStreamWithParams(sql: string, params: any[], handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : 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
* @param sql the SQL to execute. For example <code>INSERT INTO table ...</code>
* @param params these are the parameters to fill the statement.
* @param handler the handler which is called once the operation completes.
* @see java.sql.Statement#executeUpdate(String)
* @see java.sql.PreparedStatement#executeUpdate(String)
*
* 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.
*/
updateWithParams(sql: string, params: any[], handler: (result: AsyncResult<UpdateResult>) => void) : SQLClient;
queryWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : SQLClient;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
* @param sql the SQL to execute. For example <code>{call getEmpName}</code>.
* @param handler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.CallableStatement#execute(String)
*
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
*/
call(sql: string, handler: (result: AsyncResult<ResultSet>) => void) : SQLClient;
update(sql: string, handler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : 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>
* @param sql the SQL to execute. For example <code>{call getEmpName (?, ?)}</code>.
* @param params these are the parameters to fill the statement.
* @param outputs these are the outputs to fill the statement.
* @param handler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.CallableStatement#execute(String)
*
* Executes the given prepared statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement with the given parameters
*/
callWithParams(sql: string, params: any[], outputs: any[], handler: (result: AsyncResult<ResultSet>) => void) : SQLClient;
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;
}

@@ -130,36 +114,28 @@

export class SQLConnection {
/**
* 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.
* @param sql the statement to execute
* @param handler the result handler
* @return self
*
* 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: (result: AsyncResult<any[]>) => void) : SQLOperations;
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.
* @param sql the statement to execute
* @param arguments the arguments
* @param handler the result handler
* @return self
*
* 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: (result: AsyncResult<any[]>) => void) : SQLOperations;
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.
* @param options the options to modify the unwrapped connection.
*
* 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.
*/

@@ -169,122 +145,68 @@ setOptions(options: SQLOptions) : SQLConnection;

/**
* Sets the auto commit flag for this connection. True by default.
* @param autoCommit the autoCommit flag, true by default.
* @param resultHandler the handler which is called once this operation completes.
* @see java.sql.Connection#setAutoCommit(boolean)
*
* Sets the auto commit flag for this connection. True by default.
*/
setAutoCommit(autoCommit: boolean, resultHandler: (result: AsyncResult<void>) => void) : SQLConnection;
setAutoCommit(autoCommit: boolean, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Executes the given SQL statement
* @param sql the SQL to execute. For example <code>CREATE TABLE IF EXISTS table ...</code>
* @param resultHandler the handler which is called once this operation completes.
* @see java.sql.Statement#execute(String)
*
* Executes the given SQL statement
*/
execute(sql: string, resultHandler: (result: AsyncResult<void>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.Statement#executeQuery(String)
* @see java.sql.PreparedStatement#executeQuery(String)
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query.
*/
query(sql: string, resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @param handler the handler which is called once the operation completes. It will return a {@code SQLRowStream}.
* @see java.sql.Statement#executeQuery(String)
* @see java.sql.PreparedStatement#executeQuery(String)
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
queryStream(sql: string, handler: (result: AsyncResult<SQLRowStream>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @param params these are the parameters to fill the statement.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.Statement#executeQuery(String)
* @see java.sql.PreparedStatement#executeQuery(String)
*
* Executes the given SQL <code>SELECT</code> prepared statement which returns the results of the query.
*/
queryWithParams(sql: string, params: any[], resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @param params these are the parameters to fill the statement.
* @param handler the handler which is called once the operation completes. It will return a {@code SQLRowStream}.
* @see java.sql.Statement#executeQuery(String)
* @see java.sql.PreparedStatement#executeQuery(String)
*
* 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: (result: AsyncResult<SQLRowStream>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>INSERT INTO table ...</code>
* @param resultHandler the handler which is called once the operation completes.
* @see java.sql.Statement#executeUpdate(String)
* @see java.sql.PreparedStatement#executeUpdate(String)
*
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
*/
update(sql: string, resultHandler: (result: AsyncResult<UpdateResult>) => void) : SQLConnection;
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
* @param sql the SQL to execute. For example <code>INSERT INTO table ...</code>
* @param params these are the parameters to fill the statement.
* @param resultHandler the handler which is called once the operation completes.
* @see java.sql.Statement#executeUpdate(String)
* @see java.sql.PreparedStatement#executeUpdate(String)
*
* 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: (result: AsyncResult<UpdateResult>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>{call getEmpName}</code>.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.CallableStatement#execute(String)
*
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*/
call(sql: string, resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLConnection;
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>
* @param sql the SQL to execute. For example <code>{call getEmpName (?, ?)}</code>.
* @param params these are the parameters to fill the statement.
* @param outputs these are the outputs to fill the statement.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.CallableStatement#execute(String)
*
* 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: (result: AsyncResult<ResultSet>) => void) : SQLConnection;
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.
* @param handler the handler called when this operation completes.
*
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
*/
close(handler: (result: AsyncResult<void>) => void) : void;
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.
*
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
*/

@@ -294,21 +216,15 @@ close() : void;

/**
* Commits all changes made since the previous commit/rollback.
* @param handler the handler called when this operation completes.
*
* Commits all changes made since the previous commit/rollback.
*/
commit(handler: (result: AsyncResult<void>) => void) : SQLConnection;
commit(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : SQLConnection;
/**
* Rolls back all changes made since the previous commit/rollback.
* @param handler the handler called when this operation completes.
*
* Rolls back all changes made since the previous commit/rollback.
*/
rollback(handler: (result: AsyncResult<void>) => void) : SQLConnection;
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.
* @param timeoutInSeconds the max amount of seconds the query can take to execute.
*
* Sets a connection wide query timeout.
*
* It can be over written at any time and becomes active on the next query call.
*/

@@ -318,156 +234,126 @@ setQueryTimeout(timeoutInSeconds: number) : SQLConnection;

/**
* Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
* @param sqlStatements sql statement
* @param handler the result handler
*
* Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
*/
batch(sqlStatements: string[], handler: (result: AsyncResult<number[]>) => void) : SQLConnection;
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.
* @param sqlStatement sql statement
* @param args the prepared statement arguments
* @param handler the result handler
*
* 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: (result: AsyncResult<number[]>) => void) : SQLConnection;
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.
* @param sqlStatement sql statement
* @param inArgs the callable statement input arguments
* @param outArgs the callable statement output arguments
* @param handler the result handler
*
* 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: (result: AsyncResult<number[]>) => void) : SQLConnection;
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.
* @param isolation the level of isolation
* @param handler the handler called when this operation completes.
*
* 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: (result: AsyncResult<void>) => void) : SQLConnection;
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.
* @param handler the handler called when this operation completes.
*
* Attempts to return the transaction isolation level for this Connection object to the one given.
*/
getTransactionIsolation(handler: (result: AsyncResult<TransactionIsolation>) => void) : SQLConnection;
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.
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.Statement#executeQuery(String)
* @see java.sql.PreparedStatement#executeQuery(String)
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query.
*/
query(sql: string, resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLOperations;
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.
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @param params these are the parameters to fill the statement.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.Statement#executeQuery(String)
* @see java.sql.PreparedStatement#executeQuery(String)
*
* Executes the given SQL <code>SELECT</code> prepared statement which returns the results of the query.
*/
queryWithParams(sql: string, params: any[], resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLOperations;
queryWithParams(sql: string, params: any[], resultHandler: ((res: AsyncResult<ResultSet>) => void) | Handler<AsyncResult<ResultSet>>) : 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.
* @param sql the statement to execute
* @param handler the result handler
* @return self
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
querySingle(sql: string, handler: (result: AsyncResult<any[]>) => void) : SQLOperations;
queryStream(sql: string, handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : 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.
* @param sql the statement to execute
* @param arguments the arguments
* @param handler the result handler
* @return self
*
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*/
querySingleWithParams(sql: string, arguments: any[], handler: (result: AsyncResult<any[]>) => void) : SQLOperations;
queryStreamWithParams(sql: string, params: any[], handler: ((res: AsyncResult<SQLRowStream>) => void) | Handler<AsyncResult<SQLRowStream>>) : SQLOperations;
/**
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
* @param sql the SQL to execute. For example <code>INSERT INTO table ...</code>
* @param resultHandler the handler which is called once the operation completes.
* @see java.sql.Statement#executeUpdate(String)
* @see java.sql.PreparedStatement#executeUpdate(String)
*
* 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.
*/
update(sql: string, resultHandler: (result: AsyncResult<UpdateResult>) => void) : SQLOperations;
querySingle(sql: string, handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : 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
* @param sql the SQL to execute. For example <code>INSERT INTO table ...</code>
* @param params these are the parameters to fill the statement.
* @param resultHandler the handler which is called once the operation completes.
* @see java.sql.Statement#executeUpdate(String)
* @see java.sql.PreparedStatement#executeUpdate(String)
*
* 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.
*/
updateWithParams(sql: string, params: any[], resultHandler: (result: AsyncResult<UpdateResult>) => void) : SQLOperations;
querySingleWithParams(sql: string, arguments: any[], handler: ((res: AsyncResult<any[]>) => void) | Handler<AsyncResult<any[]>>) : SQLOperations;
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
* @param sql the SQL to execute. For example <code>{call getEmpName}</code>.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.CallableStatement#execute(String)
*
* Executes the given SQL statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement.
*/
call(sql: string, resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLOperations;
update(sql: string, resultHandler: ((res: AsyncResult<UpdateResult>) => void) | Handler<AsyncResult<UpdateResult>>) : 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>
* @param sql the SQL to execute. For example <code>{call getEmpName (?, ?)}</code>.
* @param params these are the parameters to fill the statement.
* @param outputs these are the outputs to fill the statement.
* @param resultHandler the handler which is called once the operation completes. It will return a {@code ResultSet}.
* @see java.sql.CallableStatement#execute(String)
*
* Executes the given prepared statement which may be an <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>
* statement with the given parameters
*/
callWithParams(sql: string, params: any[], outputs: any[], resultHandler: (result: AsyncResult<ResultSet>) => void) : SQLOperations;
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';
export class SQLRowStream {
exceptionHandler(handler: (result: Error) => void | null | undefined) : SQLRowStream;
/**
* 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[]>;
handler(handler: (result: any[]) => void | null | undefined) : SQLRowStream;
pipe() : Pipe<any[]>;
pipeTo(dst: WriteStream<any[]>) : void;
pipeTo(dst: WriteStream<any[]>, handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
exceptionHandler(handler: ((res: Error) => void) | Handler<Error> | null | undefined) : SQLRowStream;
handler(handler: ((res: any[]) => void) | Handler<any[]> | null | undefined) : SQLRowStream;
pause() : SQLRowStream;

@@ -477,9 +363,6 @@

endHandler(endHandler: (result: void) => void | null | undefined) : SQLRowStream;
endHandler(endHandler: ((res: void) => void) | Handler<void> | null | undefined) : SQLRowStream;
/**
* Will convert the column name to the json array index.
* @param name the column name
* @return the json array index
*
* Will convert the column name to the json array index.
*/

@@ -489,7 +372,5 @@ 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.
* @return the list of columns names returned by the query
*
* 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.
*/

@@ -499,11 +380,8 @@ columns() : string[];

/**
* Event handler when a resultset is closed. This is useful to request for more results.
* @param handler called when the current result set is closed
*
* Event handler when a resultset is closed. This is useful to request for more results.
*/
resultSetClosedHandler(handler: (result: void) => void) : SQLRowStream;
resultSetClosedHandler(handler: ((res: void) => void) | Handler<void>) : SQLRowStream;
/**
* Request for more results if available
*
* Request for more results if available
*/

@@ -513,4 +391,3 @@ moreResults() : void;

/**
* Closes the stream/underlying cursor(s). The actual close happens asynchronously.
*
* Closes the stream/underlying cursor(s). The actual close happens asynchronously.
*/

@@ -520,9 +397,5 @@ close() : void;

/**
* Closes the stream/underlying cursor(s). The actual close happens asynchronously.
* @param handler called when the stream/underlying cursor(s) is(are) closed
*
* Closes the stream/underlying cursor(s). The actual close happens asynchronously.
*/
close(handler: (result: AsyncResult<void>) => void) : void;
close(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>) : void;
}

@@ -1,6 +0,23 @@

/// <reference types="@vertx/sql" />
/*
* Copyright 2019 ES4X
*
* ES4X licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/// <reference types="@vertx/sql-common" />
module.exports = {
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')
};

@@ -0,80 +1,179 @@

/*
* Copyright 2019 ES4X
*
* ES4X licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Represents the results of a SQL query.
* <p>
* It contains a list for the column names of the results, and a list of <code>JsonArray</code> - one for each row of the
* results.
*/
export class ResultSet {
constructor();
constructor(obj: ResultSet);
/**
* Get the column names
* @return the column names
*
*/
columnNames: string;
getColumnNames(): string;
/**
* Get the column names
*/
setColumnNames(columnNames: string): ResultSet;
/**
* Get the next result set
* @return the next resultset
*
*/
next: ResultSet;
getNext(): ResultSet;
/**
* Get the next result set
*/
setNext(next: ResultSet): ResultSet;
/**
* Return the number of columns in the result set
*/
getNumColumns(): number;
/**
* Return the number of rows in the result set
*/
getNumRows(): number;
/**
* Get the registered outputs
* @return the outputs
*
*/
output: any[];
getOutput(): any[];
/**
* Get the registered outputs
*/
setOutput(output: any[]): ResultSet;
/**
* Get the results
* @return the results
*
*/
results: any[];
getResults(): any[];
/**
* Get the results
*/
setResults(results: any[]): ResultSet;
/**
* Get the rows - each row represented as a JsonObject where the keys are the column names and the values are
* the column values.
*
* Beware that it's legal for a query result in SQL to contain duplicate column names, in which case one will
* overwrite the other if using this method. If that's the case use <a href="../../dataobjects.html#ResultSet">ResultSet</a> instead.
*
* Be aware that column names are defined as returned by the database, this means that even if your SQL statement
* is for example: <pre>SELECT a, b FROM table</pre> the column names are not required to be: <pre>a</pre> and
* <pre>b</pre> and could be in fact <pre>A</pre> and <pre>B</pre>.
*
* For cases when there is the need for case insentivitity you should see <a href="../../dataobjects.html#ResultSet">ResultSet</a>
*/
getRows(): { [key: string]: any };
}
import { TransactionIsolation } from './enums';
import { FetchDirection } from './enums';
import { ResultSetConcurrency } from './enums';
import { ResultSetType } from './enums';
import { TransactionIsolation } from './enums';
/**
* Represents the options one can use to customize the unwrapped connection/statement/resultset types
*/
export class SQLOptions {
autoGeneratedKeys: boolean;
constructor();
constructor(obj: SQLOptions);
isAutoGeneratedKeys(): boolean;
autoGeneratedKeysIndexes: any[];
setAutoGeneratedKeys(autoGeneratedKeys: boolean): SQLOptions;
catalog: string;
getAutoGeneratedKeysIndexes(): any[];
fetchDirection: FetchDirection;
setAutoGeneratedKeysIndexes(autoGeneratedKeysIndexes: any[]): SQLOptions;
fetchSize: number;
getCatalog(): string;
queryTimeout: number;
setCatalog(catalog: string): SQLOptions;
readOnly: boolean;
getFetchDirection(): FetchDirection;
resultSetConcurrency: ResultSetConcurrency;
setFetchDirection(fetchDirection: FetchDirection): SQLOptions;
resultSetType: ResultSetType;
getFetchSize(): number;
schema: string;
setFetchSize(fetchSize: number): SQLOptions;
transactionIsolation: TransactionIsolation;
getQueryTimeout(): number;
setQueryTimeout(queryTimeout: number): SQLOptions;
isReadOnly(): boolean;
setReadOnly(readOnly: boolean): SQLOptions;
getResultSetConcurrency(): ResultSetConcurrency;
setResultSetConcurrency(resultSetConcurrency: ResultSetConcurrency): SQLOptions;
getResultSetType(): ResultSetType;
setResultSetType(resultSetType: ResultSetType): SQLOptions;
getSchema(): string;
setSchema(schema: string): SQLOptions;
getTransactionIsolation(): TransactionIsolation;
setTransactionIsolation(transactionIsolation: TransactionIsolation): SQLOptions;
}
/**
* Represents the result of an update/insert/delete operation on the database.
* <p>
* The number of rows updated is available with <a href="../../dataobjects.html#UpdateResult">UpdateResult</a> and any generated
* keys are available with <a href="../../dataobjects.html#UpdateResult">UpdateResult</a>.
*/
export class UpdateResult {
constructor();
constructor(obj: UpdateResult);
/**
* Get any generated keys
* @return generated keys
*
*/
keys: any[];
getKeys(): any[];
/**
* Get any generated keys
*/
setKeys(keys: any[]): UpdateResult;
/**
* Get the number of rows updated
* @return number of rows updated
*
*/
updated: number;
getUpdated(): number;
/**
* Get the number of rows updated
*/
setUpdated(updated: number): UpdateResult;
}

@@ -1,2 +0,18 @@

/// <reference types="@vertx/sql/options" />
/*
* Copyright 2019 ES4X
*
* ES4X licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/// <reference types="@vertx/sql-common/options" />
module.exports = {

@@ -3,0 +19,0 @@ ResultSet: Java.type('io.vertx.ext.sql.ResultSet'),

{
"name" : "@vertx/sql-common",
"description" : "Generated Eclipse Vert.x bindings for 'vertx-sql-common'",
"version" : "3.5.4",
"license" : "Apache Software License 2.0",
"version" : "3.8.4",
"license" : "Apache-2.0",
"public" : true,

@@ -10,9 +10,11 @@ "maven" : {

"artifactId" : "vertx-sql-common",
"version" : "3.5.4"
"version" : "3.8.4"
},
"dependencies" : {
"@vertx/core" : "3.5.3"
"@vertx/core" : "3.8.4"
},
"main" : "index.js",
"types" : "index.d.ts"
}
"module" : "module.mjs",
"types" : "index.d.ts",
"sideEffects" : false
}

@@ -1,3 +0,3 @@

![npm (scoped)](https://img.shields.io/npm/v/@vertx/sql.svg)
![npm](https://img.shields.io/npm/l/@vertx/sql.svg)
![npm (scoped)](https://img.shields.io/npm/v/@vertx/sql-common.svg)
![npm](https://img.shields.io/npm/l/@vertx/sql-common.svg)

@@ -8,4 +8,4 @@ Generated JavaScript bindings for Eclipse Vert.x.

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

@@ -18,7 +18,7 @@ ## Usage

// Base API
const Api = require('@vertx/sql');
const Api = require('@vertx/sql-common');
// Base ENUMs
const Enums = require('@vertx/sql/enums');
const Enums = require('@vertx/sql-common/enums');
// DataObject's
const Options = require('@vertx/sql/options');
const Options = require('@vertx/sql-common/options');

@@ -38,3 +38,3 @@ // refer to the API docs for specific help...

```js
/// <definition types="@vertx/core/runtime" />
/// <definition types="es4x.d.ts" />
// @ts-check

@@ -41,0 +41,0 @@

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