Skip to content

Add support to TXT files #16

Open
Open
@thiagodp

Description

@thiagodp

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}"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions