Skip to content

Commit

Permalink
Merge pull request #231 from pomgui/master
Browse files Browse the repository at this point in the history
Adding GDSCodes
  • Loading branch information
mariuz authored Sep 23, 2020
2 parents ff2debd + 1b9b646 commit 03fec08
Show file tree
Hide file tree
Showing 6 changed files with 844 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ node_modules/
test/*.fdb
test/*.fbk
*.fdb
.nyc_output
.vscode
coverage

# Jetbrains IDE
.idea
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,24 @@ console.log(sql3);
console.log(sql4);
```

### Using GDS codes

```js
var { GDSCode } = require('node-firebird/lib/gdscodes');
/*...*/
db.query('insert into my_table(id, name) values (?, ?)', [1, 'John Doe'],
function (err) {
if(err.gdscode == GDSCode.UNIQUE_KEY_VIOLATION){
console.log('constraint name:'+ err.gdsparams[0]);
console.log('table name:'+ err.gdsparams[0]);
/*...*/
}
/*...*/
});

```


### Service Manager functions

- backup
Expand Down
3 changes: 3 additions & 0 deletions lib/gdscodes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'node-firebird/lib/gdscodes' {
export const GDSCode;
}
Loading

0 comments on commit 03fec08

Please sign in to comment.