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

Records flat file storage #155

Open
ArnaudBuchholz opened this issue Mar 16, 2017 · 2 comments
Open

Records flat file storage #155

ArnaudBuchholz opened this issue Mar 16, 2017 · 2 comments
Assignees
Labels

Comments

@ArnaudBuchholz
Copy link
Owner

  • Handle array of records (objects)
  • Want to know if some changed (use of prototype & hasOwnProperty)
  • IO in a flat file
    • CSV / JSON?
    • Need to abstract host & streams (IFileStorage, IStream)
    • Append mode for performances, save only differences (i.e. read must adapt consequently)
    • Propose a compact feature (regenerate the file)
  • Propose filtering helpers (1 syntax but several parsers: LDAP, ODATA, ...)
  • Propose sorting helpers (might include merging several arrays)
  • Propose paging helpers? (not sure if useful in step 1 as I might need to get a long array of results anyway, slice should be enough)

For future:

  • By default, every properties will be saved (considering the record is flatten'd). Using attributes, this can be restricted or controlled more finely
  • Records could be validated through JSON schema
@ArnaudBuchholz
Copy link
Owner Author

ArnaudBuchholz commented Mar 27, 2017

gpf:createObjectStorage({
    id: "property" || [properties]
    output: IWritableStream
}) : IObjectStorage

IObjectStorage
    readAll(IReadableStream).then(records => undefined)

    add(object)
    update(object)
    remove(object)

    writeAll(IWritableStream).then(count => undefined)

@ArnaudBuchholz ArnaudBuchholz modified the milestones: Release 0.1.10: To be defined, Release 0.1.9: Records files Apr 28, 2017
@ArnaudBuchholz ArnaudBuchholz modified the milestones: Release 0.2.2: to be defined, Release 0.2.1: Side project support Jun 6, 2017
@ArnaudBuchholz
Copy link
Owner Author

Interesting behavior to implement:

  • When loading the storage, computes how much data is split over the file (0 means 1 line = 1 record, 100% means all records have more than one line)
  • Over a treshold, consolidate the file automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant