Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to TXT files #16

Open
thiagodp opened this issue Mar 1, 2018 · 0 comments
Open

Add support to TXT files #16

thiagodp opened this issue Mar 1, 2018 · 0 comments

Comments

@thiagodp
Copy link
Collaborator

thiagodp commented Mar 1, 2018

Proposal

database-js-txt

Virtual Columns

Text files could have these virtual columns:

  1. line (any line of the file)
  2. line_number

Examples:

# Line starting with Hello
SELECT `line_number`, `line` WHERE `line` LIKE "Hello%"

# First line in the file
SELECT `line` WHERE `line_number` = 1

# Number of lines in the file
SELECT COUNT( `line` )

# Number of lines in the file, different way
SELECT MAX( `line_number` )

# Last line in the file
SELECT `line` WHERE `line_number` = COUNT( `line` )

# Content from some lines
SELECT `line` WHERE `line_number` BETWEEN 5 AND 10

# Content from some lines, different way (needed?)
SELECT `line` OFFSET 5 LIMIT 5

Basic Operators

=, <>, >, >=, <, <=, LIKE, NOT, AND, OR, BETWEEN

Basic Constructions

WHERE, ORDER BY

Basic Functions

COUNT, MAX

Expected future enhancements

  • MATCHES operator, for matching a given regular expression.
    E.g., SELECT * WHERE line MATCHES "^Created at [0-9]{1,2}:[0-9]{1,2}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants