-
Notifications
You must be signed in to change notification settings - Fork 38
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
Added types implementation #77
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,7 +569,29 @@ class iSql { | |
} | ||
} | ||
|
||
|
||
exports.types = { | ||
char(length) { | ||
return length.toString() + "A"; | ||
}, | ||
packed(digits, delimiter) { | ||
return digits.toString() + "P" + delimiter.toString(); | ||
}, | ||
zoned(digits, delimiter) { | ||
return digits.toString() + "S" + delimiter.toString(); | ||
}, | ||
signed(digits, delimiter) { | ||
return digits.toString() + "I" + delimiter.toString(); | ||
}, | ||
unsigned(digits, delimiter) { | ||
return digits.toString() + "U" + delimiter.toString(); | ||
}, | ||
Comment on lines
+582
to
+587
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, XMLSERVICE doesn't support integer types with scale, so the delimiter must always be 0 and is thus unnecessary. Also, I'd also like to have separate functions for each type/length that would need no parameters, eg. |
||
float(digits, delimiter) { | ||
return digits.toString() + "F" + delimiter.toString(); | ||
Comment on lines
+588
to
+589
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather see separate Aside: I'm not sure why XMLSERVICE wants 4F2 and 8F4, when RPG says the decimal digits field must be blank (and would be 4F and 8F, respectively). |
||
}, | ||
binary(length) { | ||
return length.toString() + "B"; | ||
} | ||
}; | ||
|
||
exports.iConn = iConn; | ||
exports.iCmd = iCmd; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest changing
digits
anddelimiter
to something more descriptive. SQL uses the termsprecision
andscale
, though some may find that confusing. Perhapstotal_digits
anddecimal_digits
would be more appropriate?