Skip to content

VSQL query improvements #195

@torabian

Description

@torabian

In terms of VSQL, we need to have a better documentation, and some code changes.

1- Demo a virtual table, which simualtes 100 milion recrods, and show how it can be exported via service, to file or to socket.

WITH RECURSIVE
  input(id_start, id_limit, id_max) AS (
    SELECT 1, 110, 100  -- start cursor, limit, max_id
  ),
  seq(id) AS (
    SELECT id_start + 1 FROM input
    UNION ALL
    SELECT id + 1 FROM seq, input
    WHERE id < input.id_start + input.id_limit
      AND id < input.id_max
  ),
  words(word) AS (
    VALUES 
      ('alpha'), ('bravo'), ('charlie'), ('delta'), ('echo'),
      ('foxtrot'), ('golf'), ('hotel'), ('india'), ('juliet'),
      ('kilo'), ('lima'), ('mike'), ('november'), ('oscar'),
      ('papa'), ('quebec'), ('romeo'), ('sierra'), ('tango'),
      ('uniform'), ('victor'), ('whiskey'), ('xray'), ('yankee'), ('zulu')
  ),
  tags AS (
    SELECT row_number() OVER () AS rn, word FROM words
  )
SELECT 
  id,
  'Product #' || id AS name,
  word AS tag,
  'user' || id || '@example.com' AS email,
  datetime('now', '+' || id || ' seconds') AS created_at
FROM seq
JOIN tags ON (id % 26) + 1 = tags.rn
order by id

2- Document how to pass the limit, offset, and cursor to the queries,
3- Work both with .IsCounter and also missing it.
4- Make it super easy to be able to cast it into a query, so cli and http can access it without extra coding, (make sure workspace and user column selection is explained.
5- Record video of making this database table and how to query them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions