Giter Site home page Giter Site logo

Comments (4)

lloydchriswilson avatar lloydchriswilson commented on August 27, 2024

I have a database agnostic application that overrides System.Data.Common classes. It appears that several are missing like CommandBuilder and especially DataAdapter. Are there any plans to support these classes?

Thanks!

from duckdb.net.

Giorgi avatar Giorgi commented on August 27, 2024

No plans currently.

from duckdb.net.

lloydchriswilson avatar lloydchriswilson commented on August 27, 2024

I think it is not too hard. Using the SQLite library as a go-by (not copying) I confirmed several things and wrote DuckDBCommandBuilder and DuckDBDataAdapter. The latter appears to be trivial, but CommandBuilder is about 200 lines of verbose VB code (can be easily converted to C#). I am stuck because the DuckDBDataReader class has an overridden method called GetSchemaTable which does not really give the information that DBCommandBuilder needs to create insert, etc., commands. Specifically, the field lengths and key field info is not placed in the schema table. I think you'd have to parse the select command to get the table name and then run the Describe command to extract the information needed (or use some other API call).

I'm providing this information (and my work so far) in case you decide to try to finish the work yourself. I don't feel confident enough with the database to fix GetSchemaTable myself. It is great that you have lots of the standard ADO.Net classes working; just adding a couple more like CommandBuilder and DataAdapter would provide much better functionality. Most of the hard work is already done in the System.Data.Common classes (as you know).

One other thing: in DuckDB when you set a query parameter name, all other providers I use (SQLite, SQL Server, Oracle, MySQL, etc.) are forgiving if you include the SQL prefix when defining the parameters (e.g., you can pass $PARM1 as the parameter name) and it works OK, however DuckDB requires that the name exclude the prefix (e.g., PARM1). It was easy to fix my code, but you might want to consider this.

DuckDB.Net.Data.zip

from duckdb.net.

Giorgi avatar Giorgi commented on August 27, 2024

Thanks for investigation @lloydchriswilson. Can you send a PR for the parameter prefix issue?

from duckdb.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.