Message-ID: From: "crowmagnumb (@crowmagnumb)" To: "pgjdbc/pgjdbc" Date: Sat, 05 Oct 2024 20:24:43 +0000 Subject: [pgjdbc/pgjdbc] PR #3396: SQLData Support List-Id: X-GitHub-Author-Id: 1664445 X-GitHub-Author-Login: crowmagnumb X-GitHub-Issue: 3396 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3396 Content-Type: text/plain; charset=utf-8 ### All Submissions: * [x ] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document? * [ x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change? ### New Feature Submissions: 1. [ x] Does your submission pass tests? (But tests need to be written for it) 2. [ x] Does `./gradlew styleCheck` pass ? 3. [ ] Have you added your new test classes to an existing test suite in alphabetical order? (I have yet to write tests) Here is the start of my proposal for handling classes that implement java.sql.SQLData. I have not written any tests yet because I wanted to make sure this was even of interest to the comunity. I have been using the impossibl driver for some time now because I've been quite heavily using SQLData. But development on that driver has essentially terminated, so I was determined to get SQLData implemented here. This implementation also currently ignores things like Blob's and Clob's because it would take a little more refactoring/reuse of PgResultSet to get those working. But it handles all the other basic types and, in fact, handles all the needs I have of it at present. i.e. pretty fully functional. I wanted to show my solution with as much minimal change to the existing code as I could get and you can see I did that with basically just a couple lines added to PgResultSet. I envision PgResultSet and PgSQLInput extending the same abstract class that allows them to extract values Integer, SQLData, Blob, etc. from the same parent class. The former using the bytes[] as it currently does, and the latter using the string value.toBytes[]. So being new to this community, I don't exactly know where to start on this and since it feels like a pretty big addition, I thought I would just present what I have and start the discussion before putting more work in. Cheers