Skip to content

Commit 588acf7

Browse files
committed
Added float,real and money types
1 parent cf7d8a4 commit 588acf7

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ VALUES
6060

6161
Following types are supported:
6262
* ``string``
63-
* ``number``
63+
* ``number`` (will be converted to MSSQL ``int``)
6464
* ``bigint``
6565
* ``boolean`` (will be converted to MSSQL ``bit``)
66-
* ``date``
66+
* ``float``
67+
* ``date`` (will be converted to ``DateTime2``)
68+
* ``money``
6769

6870
more details can be found [here](https://github.com/elasticio/mssql-component/blob/master/lib/actions/insert.js#L25)
6971

lib/actions/insert.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const cosql = require('co-mssql');
55

66
let pstmt;
77

8-
const VARS_REGEXP = /@([\w_$][\d\w_$]*:(string|boolean|date|number|bigint))/g;
8+
const VARS_REGEXP = /@([\w_$][\d\w_$]*:(string|boolean|date|number|bigint|float|real|money))/g;
99

1010
/**
1111
* This function will be called during component intialization
@@ -37,9 +37,18 @@ function init(cfg) {
3737
case 'number':
3838
pstmt.input(name, cosql.Int);
3939
break;
40+
case 'float':
41+
pstmt.input(name, cosql.Float);
42+
break;
43+
case 'real':
44+
pstmt.input(name, cosql.Real);
45+
break;
4046
case 'boolean':
4147
pstmt.input(name, cosql.Bit);
4248
break;
49+
case 'money':
50+
pstmt.input(name, cosql.Money);
51+
break;
4352
case 'date':
4453
pstmt.input(name, cosql.DateTime2);
4554
break;

0 commit comments

Comments
 (0)