breck7 / breck7/research

Core: to/from normalized tables method idea

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
17
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Add some type of Normalized mini-language to facilitate more general to/from sql tables.

For now let's have ability to generate multiple CSVS from 1 tree, 1 csv table for each relevant table.

Basically turning a graph into a DAG and vice versa.

Lots of ways this can be done. Some introduce new syntax and some just introduce some conventions.

One idea is below. There is a root table and everything must be reachable from that. The Table names cannot contain a space. The table names come first like in a prefix tree language. The uniqueId is a combination of cell 1 after the table name, joined to the end of any preceding uniqueIds. Columns cannot contain newlines. Not sure if there would be ambiguities in determining what should be a new table vs what should just be an attribute column. Most of the time should be easy to tell, but sometimes there maybe should be a new table (not just an attribute) but hard to tell from the small given subset. Not sure if that's a realistic problem.

```
test normalized
arrange
require ../index.js jtree.TreeNode
constructWithParagraph
person joesmith
firstName joe
lastName smith
contactInfo office
type office
phone 123-456
contactInfo mobile
type mobile
phone 222-222
friendship janeDoe
friendship somedude
person somedude
person janeDoe
job 1
title boss
contactInfo home
phone 321-231
friendship joesmith
toNormalizedDelimited
assertParagraphIs
person
id,firstName,lastName
joesmith,joe,smith
somedude,,
janeDoe,,

contactInfo
id,type,phone
joesmith office,office,123-456
joesmith mobile,mobile,222-222
janeDoe home,,321-231

friendship
id
joesmith janeDoe
joesmith somedude
janeDoe joesmith

job
id,title
janeDoe 1,boss
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The example references ../index.js, jtree.TreeNode, and a test normalized scenario; start by locating those entry points and any existing tree or delimited-table behavior. Clarify the proposed normalization conventions before implementation. Done would mean converting the example tree into the expected person, contactInfo, friendship, and job CSV sections, and defining the reverse conversion if it remains in scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.