synle / sqlui-native

SQLUI Native (sqluinative) is a simple UI client for most SQL Engines written in Electron. It is compatible with Windows, Mac, Ubuntu / Debian and Redhat. It supports most dialects of RMBDs like MySQL, Microsoft SQL Server, Postgres, SQLite and has limited supports for Cassandra, MongoDB, Redis, CockroachDB, Azure CosmosDB and Azure Storage Tab
https://synle.github.io/sqlui-native/
MIT License
61 stars 8 forks source link

Redis only - scan and map records based on a max num #316

Closed synle closed 2 years ago

synle commented 2 years ago

This is iffy, not sure if it's a good idea to support and if it is, should it be done as a map for table vs columns?

image

Sample PR code

The code for this is ready here, but will not merge until we can find a better UX. https://github.com/synle/sqlui-native/pull/331/files

Sample code used to scan the iterator

for await (const key of client.scanIterator(iteratorParams)) {
        res.push({
          name: key,
          columns: [],
        })

        if(res.length === 15){
          // top it off at max records
          break;
        }
      }
synle commented 2 years ago

There can be many records inside of Redis. So it's not a good idea to scan it all just to infer the schema.