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

Add support for binary types #3

Closed
mp911de opened this issue Nov 10, 2018 · 6 comments
Closed

Add support for binary types #3

mp911de opened this issue Nov 10, 2018 · 6 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@mp911de
Copy link
Member

mp911de commented Nov 10, 2018

We should add support for VARBINARY to support ByteBuffer/byte[] representations of binary data.

@mp911de mp911de added the type: enhancement A general enhancement label Nov 10, 2018
@nebhale nebhale added this to the 1.0.0.M7 milestone Nov 20, 2018
@mp911de mp911de modified the milestones: 1.0.0.M7, 1.0.0.M8 Feb 8, 2019
@uaihebert
Copy link
Contributor

Hello, I am willing to look into this, but I will need more info. I still new in r2dbc.

I noticed that we got the enum SqlServerType.

I was able to find this:

    VARBINARY(Category.BINARY,          "varbinary"),
    VARBINARYMAX(Category.LONG_BINARY,  "varbinary"),

When you say: " to support ByteBuffer / byte[] " it would mean new type on the SqlServerType? or create a new TdsDataType and include on the SqlServerType construtor?

@uaihebert
Copy link
Contributor

uaihebert commented Feb 11, 2019

I just found the TypeBuilder. should there be the new support added?

@uaihebert
Copy link
Contributor

or maybe if you have any material that I should read/practice before going further, it would be good. ( :

@mp911de
Copy link
Member Author

mp911de commented Feb 12, 2019

Here are a few pointers:

Places that contain already support for BIGBINARY/BIGVARBINARY:

  • TdsDataType
  • SqlServerType
  • TypeBuilder

Places to change:

  • New ByteArrayCodec
  • New ByteBufferCodec
  • DefaultCodecs, add the new codecs.

I'm not sure regarding the default data type, I suppose it would make the most sense to decode binary types to byte[].

A tip for testing: I used the JDBC driver to set up a test case (create table, insert data, select data) and then use the verbose logging (see https://docs.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-2017, logger com.microsoft.sqlserver.jdbc.internals.TDS.DATA) to intercept the wire protocol. Another possibility is using wireshark or tcpdump.

@uaihebert
Copy link
Contributor

hello, I will invest time in this task this week.

Could you just help me with one more thing? I want to create a local table, what should be the correct column type?

@mp911de
Copy link
Member Author

mp911de commented Feb 17, 2019

There would be three types:

@mp911de mp911de closed this as completed in 3b554df Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants