Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tediousjs/tedious into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurschreiber authored Jul 11, 2022
2 parents e02c7c1 + 600a104 commit 3f19bc7
Show file tree
Hide file tree
Showing 71 changed files with 4,587 additions and 7,185 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parser: "@typescript-eslint/parser"

parserOptions:
sourceType: "module"
project: "./tsconfig.json"

plugins:
- "@typescript-eslint"
Expand Down Expand Up @@ -93,7 +94,7 @@ rules:
message: "Use `new` keyword when throwing an `Error`.",
}
]
no-return-await: "error"
no-return-await: "off"
no-self-assign: "error"
no-self-compare: "error"
no-tabs: "error"
Expand Down Expand Up @@ -193,6 +194,7 @@ overrides:
"@typescript-eslint/prefer-namespace-keyword": "error"
"@typescript-eslint/triple-slash-reference": "error"
"@typescript-eslint/type-annotation-spacing": "error"
"@typescript-eslint/return-await": ["error", "always"]
"no-var": "error"
"prefer-const": "error"
"prefer-rest-params": "error"
Expand Down
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---
<!--
Have you read our official documentation? This includes a FAQ section which may contain info that can solve your problem.
You can find it here: https://tediousjs.github.io/tedious/
-->

**Software versions**
* Tedious:
* SQL Server:
* Node.js:

**Additional Libraries Used and Versions**
<!-- Provide any additional libraries used on top of Tedious (e.g. node-mssql v8.0.2). -->

**Table schema**
<!-- Provide the table schema to reproduce the issue. -->

**Connection configuration**
`
// Paste your connection config here.
`

**Problem description**
<!-- Provide full details of the problem, including steps to reproduce the issue. -->

**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->

**Actual behavior**
<!-- Output of what you actually see. -->

**Error message/stack trace**
<!-- Complete error message and stack trace. -->

**Any other details that can be helpful**
<!-- Add any other context about the problem here. -->
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "[FEATURE REQUEST]"
labels: feature-request
assignees: ''

---

**Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the preferred solution**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->

**Reference Documentations/Specifications**
<!-- Provide links to any related documentation. -->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Question
about: Ask a question
title: "[QUESTION]"
labels: Q&A
assignees: ''

---

**Question**
<!-- What is the question that you have? Please be detailed and give examples. -->

**Relevant Issues and Pull Requests**
<!-- If there are relevant issues and pull requests please list and link them here. -->
17 changes: 17 additions & 0 deletions .github/workflows/lint-pull-request-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Lint Pull Request Title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Lint Pull Request Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x, 18.x]
fail-fast: false

services:
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ environment:
- nodejs_version: "12"
- nodejs_version: "14"
- nodejs_version: "16"
- nodejs_version: "18"

branches:
only:
Expand Down
11 changes: 5 additions & 6 deletions examples/bulk-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ function createTable() {
//--------------------------------------------------------------------------------
function loadBulkData() {
const option = { keepNulls: true }; // option to enable null values
const bulkLoad = connection.newBulkLoad(table, option, (err, rowCont) => {
const bulkLoad = connection.newBulkLoad(table, option, (err, rowCount) => {
if (err) {
throw err;
}

console.log('rows inserted :', rowCont);
console.log('rows inserted :', rowCount);
console.log('DONE!');
connection.close();
});
Expand All @@ -74,10 +74,9 @@ function loadBulkData() {
bulkLoad.addColumn('c1', TYPES.Int, { nullable: true });
bulkLoad.addColumn('c2', TYPES.NVarChar, { length: 50, nullable: true });

// add rows
bulkLoad.addRow({ c1: 1 });
bulkLoad.addRow({ c1: 2, c2: 'hello' });
// add rows into an array
const rows = [{ c1: 1 }, { c1: 2, c2: 'hello' }];

// perform bulk insert
connection.execBulkLoad(bulkLoad);
connection.execBulkLoad(bulkLoad, rows);
}
4 changes: 1 addition & 3 deletions examples/minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var config = {

const connection = new Connection(config);

connection.on('connect', (err) => {
connection.connect((err) => {
if (err) {
console.log('Connection Failed');
throw err;
Expand All @@ -26,8 +26,6 @@ connection.on('connect', (err) => {
executeStatement();
});

connection.connect();

function executeStatement() {
const request = new Request('select * from MyTable', (err, rowCount) => {
if (err) {
Expand Down
4 changes: 2 additions & 2 deletions examples/prepared.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const connection = new Connection(config);

const table = '[dbo].[test_prepared]';

connection.on('connect', (err) => {
connection.connect((err) => {
if (err) {
console.log('Connection Failed!');
throw err;
Expand Down Expand Up @@ -53,7 +53,6 @@ function prepareSQL() {
throw err;
}

executePreparedSQL(request);
});

// Must add parameters
Expand All @@ -62,6 +61,7 @@ function prepareSQL() {

request.on('prepared', () => {
console.log('request prepared');
executePreparedSQL(request);
});

connection.prepare(request);
Expand Down
2 changes: 1 addition & 1 deletion examples/table-valued-parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const storedProcedure = '[dbo].[test_sp_tvp]';
const table = '[dbo].[test_tvp]';
const table_type = 'TableType';

connection.on('connect', (err) => {
connection.connect((err) => {
if (err) {
console.log('connection err');
throw err;
Expand Down
2 changes: 1 addition & 1 deletion examples/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const connection = new Connection(config);

const table = '[dbo].[test_transact]';

connection.on('connect', (err) => {
connection.connect((err) => {
if (err) {
console.log('connection err');
throw err;
Expand Down
Loading

0 comments on commit 3f19bc7

Please sign in to comment.