Repository: tediousjs/node-mssql (js)

Issue:
[Feature Request] Set readOnlyIntent with connection string
If I have to build connection string and set readOnlyIntent how can I set ? Below is what I am trying to do ..

const connectionString = `Server=${blah};Database=${blah};UID=${username};
PWD=${blah};ApplicationIntent=ReadOnly`; but not working


### Software versions
  * node-mssql: 4.3.0



Pull request:
Add readOnlyIntent to connection string parsing
What this does:

Fixes #848 

Adds the ability to set readOnlyIntent via a connection string. Official docs: https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client?view=sql-server-2017

Patch:
diff --git a/lib/connectionstring.js b/lib/connectionstring.js
index 20ba951..2bd614d 100644
--- a/lib/connectionstring.js
+++ b/lib/connectionstring.js
@@ -226,6 +226,7 @@ const resolveConnectionString = function (string, driver) {
     requestTimeout: oror(parsed.requestTimeout, parsed['request timeout']),
     stream: stream === 'true' || stream === 'yes' || stream === '1',
     options: {
+      readOnlyIntent: parsed.applicationintent && parsed.applicationintent.toLowerCase() === 'readonly',
       encrypt: encrypt === 'true' || encrypt === 'yes' || encrypt === '1'
     }
   }


Test patch:
diff --git a/test/common/unit.js b/test/common/unit.js
index b4d3744..2b31f1e 100644
--- a/test/common/unit.js
+++ b/test/common/unit.js
@@ -75,7 +75,7 @@ describe('Connection String', () => {
     return done()
   })
 
-  return it('Connection String #7 (connection timeout)', done => {
+  it('Connection String #7 (connection timeout)', done => {
     let cfg = cs.resolve('Server=192.168.0.1;Database=testdb;User Id=testuser;Password=testpwd;Connection Timeout=30')
     assert.strictEqual(cfg.user, 'testuser')
     assert.strictEqual(cfg.password, 'testpwd')
@@ -86,6 +86,20 @@ describe('Connection String', () => {
 
     return done()
   })
+
+  it('Pulls out read only ApplicationIntent', done => {
+    const cfg = cs.resolve('Server=192.168.0.1;Database=testdb;User Id=testuser;Password=testpwd;Connection Timeout=30;ApplicationIntent=ReadOnly')
+    assert.strictEqual(cfg.options.readOnlyIntent, true)
+
+    return done()
+  })
+
+  it('Pulls out read write ApplicationIntent', done => {
+    const cfg = cs.resolve('Server=192.168.0.1;Database=testdb;User Id=testuser;Password=testpwd;Connection Timeout=30;ApplicationIntent=ReadWrite')
+    assert.strictEqual(cfg.options.readOnlyIntent, false)
+
+    return done()
+  })
 })
 
 describe('Unit', () => {