Skip to content

Microsoft SQL Server Support (Preview) #2430

Closed

Description

@willianhf

Problem

I was considering to use Prisma into my project but it doesn't support MSSQL.

Suggested solution

Build support to Microsoft SQL Server and expand supported databases.

Activity

  1. added
    kind/feature
    tech/engines
    and removed
    kind/feature
    on May 13, 2020
  2. self-assigned this
    on Jun 9, 2020
  3. pimeys commented on Jun 9, 2020

    @pimeys

    We now have a crate for Rust (https://github.com/prisma/tiberius/) and Quaint has preliminary support for MSSQL queries.

    Next up is Query Engine that needs a bit more dramatic changes.

    It seems at least in the beginning users can only use TCP for connecting. Named pipes come later when we have a proper crate to support them in the async ecosystem.

    Is there a need for the Local Procedure Call protocol? This might get trickier due to there not being any documentation on how the API should work.

  4. beem812 commented on Jun 9, 2020

    @beem812
  5. pimeys commented on Jun 10, 2020

    @pimeys

    Ah no. Talking about how to connect to the SQL Server. We now can support TCP, which means on Windows platforms one must enable TCP communication separately before being able to use Tiberius and therefore Prisma.

    There's ongoing work on creating an asynchronous interface for the Windows named pipes protocol. When this crate is done, we can inject it when creating a Tiberius client, allowing Prisma to connect using named pipes. The named pipes protocol also requires one to enable it in the SQL Server settings; it is not enabled by default.

    The third, mysterious protocol is the LPC. Or what I'm guessing SQL Server is using by default on Windows for connecting to it in-memory. There's an async version of it called ALPC, but this and LPC are both undocumented, which really sucks if you want to write a client for it. It seems the Windows RPC protocol is using ALPC under the surface when communicating on the same machine, but does the protocol work together with the SQL Server? We don't know yet.

    What would happen with the SQL Server and Prisma at least now is we only support TCP, and later this year can support the named pipes too on Windows platforms. For the in-memory protocol, it might require a huge amount of work in an unknown land of undocumented Windows NT API's, and might not be worth it if majority of our users don't need it.

    But. The SQL Server Docker image is TCP only. Azure SQL is TCP. These might be the current day uses for the product and there we could make lots of users happy with Prisma. The question is then some enterprise installations and could we use Prisma in those environments.

  6. pimeys commented on Jun 10, 2020

    @pimeys

    The connection string chosen now is the JDBC version, compared to the URI format for other databases. This is mainly due to Azure SQL either giving that or the ADO.NET string from their control panel, and we can differentiate the database easier with the JDBC version.

  7. pimeys commented on Jun 10, 2020

    @pimeys

    For supported types, in Tiberius everything is covered except the user-defined types that contain CLR assembly. If there's ever a need for those in Prisma, hopefully somebody will write a ticket on the subject.

    We support XML also in Tiberius, but might not add support to Prisma yet until, again, somebody writes about it and how would they use the type in their applications. What Tiberius does is just plain stringifying the XML and probably crashing if somebody stores binary data in an XML field.

  8. pimeys commented on Jun 10, 2020

    @pimeys

    To be able to support all the features in Prisma, a certain SQL Server version is required. One that I was just looking for is the OFFSET X ROWS FETCH NEXT Y ROWS ONLY construct, that seems to be available from SQL Server 2012 forward. This means if using earlier versions, the windowing would just panic out due to badly formed SQL.

    The other construct we need for relation inserts is the MERGE statement. This is also only available in SQL Server 2008 and later.

    Do we need to support older SQL Server versions? I guess Azure has always the latest version... So maybe we're not helping that much in some legacy enterprise installations or we should at least provide restrictions in the API regarding the version of the server.

  9. pimeys commented on Jun 10, 2020

    @pimeys

    We do not yet support column encryption (CEK) and columns using it will either produce garbage or panic. Do we want to support it, is it a feature our users will need in 2020?

  10. 23 remaining items

  11. changed the title [-]MSSQL Support[/-] [+]Microsoft SQL Server Support[/+] on Oct 27, 2020
  12. changed the title [-]Microsoft SQL Server Support[/-] [+]Microsoft SQL Server Support (Preview)[/+] on Oct 28, 2020
  13. thebiglabasky commented on Oct 28, 2020

    @thebiglabasky

    Hi everyone!

    We released a preview of Microsoft SQL Server in 2.10.0 which adds support for introspection and the client.
    We'd love to hear your feedback to see what you think!

    I've opened a separate issue for the follow-up work to consider to bring it to a GA state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/featuretech/enginestopic: connectortopic: prisma-clienttopic: sql server

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions