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

Allow the Connection constructor to accept a single object for configuration. #25

Closed
abmusse opened this issue Jan 25, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@abmusse
Copy link
Member

abmusse commented Jan 25, 2019

I propose we allow iConn constructor to accept a single object for configuration

This would serve as the recommended v1.0.0 of creating a new iConn object.

The current signature allowing of (database, user, password [,restOptions]) will still be compatible.

Benefits:

  • We can add an option transport to allow new transports to be specified see Add New Transports #26

  • We can add an option returnError to allow for errors for errors to be set within the user passed call back to iConn.run function see Callback function should receive error parameter #2. By default this would be set to true when using single object signature.

  • We can added an option returnXml to allow for raw xml output when set to true and output from xmlToJson when set to false. By default this would be set to false so that users don't have to call xmlToJson after run()

  • We can addnew options as needed in the future.

  • We do not have to care about positional parameters.

@abmusse abmusse mentioned this issue Jan 25, 2019
3 tasks
@abmusse abmusse self-assigned this Jan 25, 2019
@abmusse abmusse added the enhancement New feature or request label Jan 25, 2019
@abmusse abmusse added this to the Version 1.0 milestone Jan 25, 2019
@abmusse abmusse changed the title Allow the iConn() constructor to accept a single object for configuration. Allow the ~~iConn()~~ constructor to accept a single object for configuration. Mar 5, 2019
@abmusse abmusse changed the title Allow the ~~iConn()~~ constructor to accept a single object for configuration. Allow the ~iConn()~ constructor to accept a single object for configuration. Mar 5, 2019
@abmusse abmusse changed the title Allow the ~iConn()~ constructor to accept a single object for configuration. Allow the ~~iConn()~~ constructor to accept a single object for configuration. Mar 5, 2019
@abmusse abmusse changed the title Allow the ~~iConn()~~ constructor to accept a single object for configuration. Allow the Connection constructor to accept a single object for configuration. Mar 5, 2019
abmusse added a commit that referenced this issue Mar 11, 2019
Allow Connection.js Constuctor to accept a single object see #25
Allow Connection.run() function to return error as first param of callback see #2

Establish one code path in Connection Constructor
- when pre v1.0 signature is used create an options object
- add properties to this options object
- this mimics the current v1.0 way of passing a signle object
- that way constructor follows on code path

Options object contain sub object transportOptions
- This contains properties such as databse, username, etc
- This sub object is passed to the transport

Rename variables away from I_* prefix
Rename getConnection() -> getTransportOptions()
Rename cmd -> commandList

Moved verbose to be a property of Connection
- verbose is added to transportOptions during run()
- this is because verbose can be adjusted with debug()
- add print of xmlOutput also when in verbose mode
@abmusse
Copy link
Member Author

abmusse commented Mar 12, 2019

Changes added in with PR #42

@abmusse abmusse closed this as completed Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant