Repository navigation
Description
Since the development on tedious has slowed down quite a bit in recent times, I want us (the tedious community) to put down a more or less formal roadmap of areas in tedious that need attention and should be worked on. This will help us maintainers to focus on these topics, while giving new contributors an idea of what they could be working on.
These topics don't have to necessarily be focusing on a specific bug or issue, but can be more general as well.
I will put down things that come to my mind in this issue, please feel free to suggest more topics. Once we have a good sized list, we can prioritize these and map out a rough timeline.
General / Documentation
-
Better contributor guidelines: We should make it clear what we expect from contributions (tests, coding style, etc). We should also document why some test cases are still written in CoffeeScript.
-
Better README: The readme should better reflect the goals and history of tedious.
-
More Contributors: Everyone who contributes to ´tedious´ should get commit access.
-
More Releases: WE should be able to push more releases, more often. We've not had a release for a loooong time, and that's bad. We should be able to push a new release monthly.
Documentation
- Better documentation: The documentation is currently stored in the
gh-pagesbranch and maintained separately from everything else. We should move all documentation to be generated from the source code usingdocumentation.jsor a similar tool.
Performance
-
The parser is quite slow. This is mostly due to the fact that we use a lot of nested callbacks. I've done some experiments using a function trampoline instead, where each parsing function returns the next parsing function (or
undefinedif not enough data was received), with very promising performance benefits. Unfortunately, rewriting all of the token parsing functions is a lot of work. -
Many other areas of the code follow coding style practices that keep them from being JIT compiled by V8.
Tests
-
Tests are still written in CoffeeScript, and should be converted everything to ES2017 compatible code instead.
-
nodeunittest cases are often really hard to debug and sometimes it's not quite clear where bugs happen or assertions fail. We probably should move over to ´mocha´ or ´jest´.
Code Style
- Clean up messy leftover code from the CoffeeScript to JavaScript conversion.
- Update to latest version of Babel and allow ES2017 features.
Features
- "Native" JSON support?
- Integrated Authentication.
- Retries on Transient Failures. (Retries on transient failures #456)
- All the flavors of Active Directory Authentication.
- Unsupported Types: INTN, NTEXT, BITN, DECIMALN, NUMERICN, FLTN, MONEYN, DATETIMN, XML, UDTTYPE, SSVARIANTTYPE
- Always Encrypted
- Query Notifications
- Support for SQL Server Express LocalDB via named pipes
Activity
lloydcotten commentedon Feb 23, 2017
For test framework / runner... might I suggest a couple of more possibilities:
This is just coming from my own experience of using mocha and finding that my tests tend to run faster and are cleaner with a TAP-style test framework (and supports concurrent test running). I've personally used
node-tapandavaand I like them both.node-tapis more of framework that includes test coverage using nyc, etc.Any of them (including
mochaorjest) is better thannodeunitIMO. I would be willing to contribute to this effort once clear guidelines and direction is chosen.spanditcaa commentedon Feb 23, 2017
An alternative approach to the parser performance issue could come from FOR JSON support, as discussed in #317.
arthurschreiber commentedon Feb 23, 2017
I don't think "native" JSON support in tedious will help here at all. The JSON support from SQL Server works by sending back one result row containing a single column containing all the JSON data. We'd have to parse this using
JSON.parse, which is a blocking operation. So the parser is still used, and focus should be on making it fast even with native JSON support. 😄tvrprasad commentedon Feb 23, 2017
Thanks for putting this together @arthurschreiber !
Can you please clarify what exactly this would mean in practice?
Features missing that I can think of:
o More hardening than a feature but valuable I believe - Retries on transient failures #456
I can take the lead on this if you can give some pointers on what's left to be done.
arthurschreiber commentedon Feb 23, 2017
I want to grant every person that contributes a PR (and has that PR accepted) with commit access to the repo. We can enable required code review to ensure people don't push random things to the master branch, but I've worked on other open source projects that followed a similar policy and we never had any issues.
tvrprasad commentedon Feb 23, 2017
Would there be a smaller code reviewers group that can approve changes? WebKit follows that model and seems to work well for them - https://webkit.org/commit-and-review-policy/.
I'd be curious to know what those projects are. Intuitively a single PR seems a bit lax for giving commit access but you certainly have lot more experience than me with open source :-)
arthurschreiber commentedon Feb 23, 2017
@tvrprasad See http://felixge.de/2013/03/11/the-pull-request-hack.html and more ideas over at https://opensource.guide/building-community/
Previously, I worked on Rubinius, an alternative Ruby VM, and they employed the same policy back in 2008 (and might still do, I haven't checked 😄).
tvrprasad commentedon Feb 23, 2017
Thanks @arthurschreiber - interesting reading. Especially the pull-request-hack experience is fascinating.
There are a few checks mentioned though beyond an accepted PR. Specifically these are listed in http://felixge.de/2013/03/11/the-pull-request-hack.html:
Do you plan on having these and/or other checks beyond an accepted PR?
Also what different roles should we have? I see words like committer, collaborator, reviewer flying around :) Listing out roles (whether it's 1 or 5) and responsibilities, and how you move from one role to other (even if it's just @arthurschreiber decides :-)) might be useful.
chdh commentedon Feb 28, 2017
Features:
(I will send a pull request shortly).
chdh commentedon Mar 2, 2017
After having spent some time extending Tedious (implementing pause/resume), I think that the internal architecture of the TDS protocol driver should be reworked. The current Connection class module is 1,368 lines long and contains a web of events and callbacks. There should be a clear data flow architecture for the incoming and outgoing data streams, and the protocol state machine should be better encapsulated.
The incoming data flow pipeline has the following structure:
[socket] -> bytes -> [packet stream transform] -> packets -> message chunks -> [token stream parser transform] -> tokens -> rows
The structure of the source code should clearly represent this data flow architecture. The TDS protocol state machine should be encapsulated in a separate module and isolated from the rest and from the two data flow pipelines.
Each class should have a short description. It should be visible which class/module members (methods/functions and properties/variables) are part of the (public) interface of the class/module and which are internal (private). I suggest to use TypeScript to improve code quality.
arthurschreiber commentedon Mar 8, 2017
I don't think we will ever support this. From all what I know about this feature, there is 0 advantage of using MARS over just using a connectionpool and opening multiple connections.
If we wanted to support this, we'd have to implement MC-SMP, but not as part of
tediousbut as a separate library that we could then use in tedious.@tvrprasad What do you think?
tvrprasad commentedon Mar 8, 2017
I'll ask around here to get some insight on value add from MARS and get back. If you have any references that make an argument for why there is no value, please send them my way.
chdh commentedon Mar 9, 2017
It depends on the use case. For a normal web application or web service, you are right. But if you have a complex client side application with multiple large data-bound components that communicates with a Node backend via a (multiplexed) WebSocket, the situation is different. And when multiple SQL Server logins are used, you have to use a connection pool per login.
tvrprasad commentedon Mar 10, 2017
From what I gather the only advantage is saving some connections which gives two advantages:
o This is only for the case where you don't already have a warm connection in the pool.
But MARS also comes with performance overhead due to managing interleaved query execution. That seems to be the experience with other drivers that implement this.
Doesn't seem like much of a win. My take would be that we consider this only if we have specific use cases that show concrete gains.
Not sure why MARS would be advantageous here over creating multiple connections. How the App communicates with the Node backend seems orthogonal to how Node backend communicates with SQL Server (multiple SQL connections vs MARS)
You will need multiple Connections here with MARS also.
That makes sense, if we wanted to support this.
Hadis-Fard commentedon Oct 26, 2017
@arthurschreiber @tvrprasad We're planning to start stabbing this list, could you shed some light on this feature?
tvrprasad commentedon Oct 26, 2017
@Hadis-Fard I just know that ADO.net supports that. Perhaps this link may provide you a starting point - https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/query-notifications-in-sql-server
arthurschreiber commentedon Oct 27, 2017
@Hadis-Fard @tvrprasad
For query notifications, I think what's still missing is the
Query Notifications Headeras specified in2.2.5.3.1.I've no concrete idea how the API for exposing the query notification header options might look like - maybe something like this?
This could then cause the correct data to be sent via the query notifications header.
Listening to query notification events could then be handled via the "regular" T-SQL statements like
WAITFOR (RECEIVE * FROM MyQueue);orRECEIVE * FROM MyQueue;. What do you think? Would you like to take a stab at implementing this? 😄Hadis-Fard commentedon Oct 27, 2017
looks good to me on setting the options, it also should have getter similar to SQLGetStmtAttr in here
which i think it can be done by adding the notification into callback
Would love to stab this, I am currently working on AzureAD auth, will put this in my list