2

I have data in a postgres database, I'm currently creating a sqlite db on disk, and then streaming it for clients. I'd prefer to skip the write to file step, and just stream from memory. I haven't seen any Java sqlite options that allows this.

Apparently a virtual file system (in memory) doesn't help with this either AFAICT.

Joel
  • 2,601
  • 4
  • 33
  • 44
  • So in cleartext, you are trying to run sqlite as an in-memory database? – Philipp Mar 25 '15 at 18:16
  • Yes. write new db in-memory, and then dump the contents as stream. I'm thinking of using sqljet and getting at the internals for the stream, very unclear. – Joel Mar 26 '15 at 19:28
  • this is the closest thing I've found: https://code.google.com/p/sqljet/issues/detail?id=125. However, there is no api to create a stream. – Joel Mar 26 '15 at 19:50

1 Answers1

1

SQLite supports on-memory database management, which does not create any database files.

Connection connection = DriverManager.getConnection("jdbc:sqlite::memory:");

see https://github.com/xerial/sqlite-jdbc#how-to-use-memory-databases

Streaming or passing to other computers is not database feature, just use any binary or text-based protocols like JSON over TCP/IP.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332