Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relevant IntelliJ Ultimate and ESLint linting warnings in examples #90

Merged
merged 2 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function tearDown() {
client.end()
}

async function main() {
async function getAllEmployees() {
await setup()

// Run SELECT query
Expand All @@ -42,6 +42,8 @@ async function main() {
console.log(res)

await tearDown()

return res
}

main()
getAllEmployees().then(console.log).catch(console.log)
12 changes: 5 additions & 7 deletions examples/parameterized-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// 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.

const { Client } = require('vertica-nodejs')

const client = new Client()
Expand All @@ -32,16 +31,15 @@ async function tearDown() {
client.end()
}

async function main() {
async function getEmployeesOlderThan50() {
await setup()

// Run parameterized query
var res = await client.query('SELECT * FROM Employee WHERE age > ?', [50])

// print results
console.log(res)
const res = await client.query('SELECT * FROM Employee WHERE age > ?', [50])

await tearDown()

return res
}

main()
getEmployeesOlderThan50().then(console.log).catch(console.log)
11 changes: 5 additions & 6 deletions examples/prepared-statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ async function tearDown() {
client.end()
}

async function main() {
async function getEmployeesOlderThan50() {
await setup()

// Run prepared statement
var res = await client.query(fetchOlderQuery)

// print results
console.log(res)
const res = await client.query(fetchOlderQuery)

await tearDown()

return res
}

main()
getEmployeesOlderThan50().then(console.log).catch(console.log)
16 changes: 7 additions & 9 deletions examples/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,22 @@ async function tearDown() {
client.end()
}

async function main() {
async function getAllEmployees() {
await setup()

// Run UPDATE query
var res = await client.query('UPDATE Employee SET age = age + 1')
const res = await client.query('UPDATE Employee SET age = age + 1')

// print results
console.log("UPDATE complete")
console.log('UPDATE complete')
console.log(res)

// Run SELECT query
var allRows = await client.query('SELECT * FROM Employee')

// print results
console.log("SELECT complete")
console.log(allRows.rows)
const allRows = await client.query('SELECT * FROM Employee')

await tearDown()

return allRows.rows
}

main()
getAllEmployees().then(console.log).catch(console.log)