1

I have an in-memory database embedded in my application and I want other applications to be able access it via ODBC.

After searching for an hour, I think I have 2 options.

  1. Write my own ODBC Driver which knows how to talk my application via the network.
  2. Implement MySQL or Postgres wire protocol in my application so that the client application can use MySQL/Postgres drivers.

According to Creating a custom ODBC driver writing my own driver is a huge task and should not be taken lightly.

So here are my questions.

  1. If I have to implement the wire protocol, am I correct in assuming that I can just create a thread which talks to database and communicates with the clients over the network? That sounds fairly simple to me.
  2. Do you know of any reasons why I should choose one of MySQL/Postgres/Some other wire protocol over the others? My queries will be basic SELECT statements.
  3. Is there any simpler way to access my in-memory sqlite DB via ODBC?

I'm new to the world of databases and would appreciate any pointers for further reading.

Community
  • 1
  • 1

1 Answers1

1

You should create your own ODBC driver. Maybe you don't need to implement all ODBC functionality, and a subset will do.

Trying to emulate a different database with its quirks and idiosyncrasies will probably be more difficult.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263