Skip to content

Commit

Permalink
[doc] Tables for the "table-object-doc" design
Browse files Browse the repository at this point in the history
Notation, Query, Creation, Schema, In-Memory

Writing down these "maximalist" ideas from July and September

I started thinking about this again because of the HTM8 lexer!  (Up
next: <script> and <style> quirks)
  • Loading branch information
Andy C committed Jan 9, 2025
1 parent 09e8d9a commit 986fbea
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build/doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ readonly MARKDOWN_DOCS=(
byo
ysh-doc-processing

table-object-doc

lib-osh

doc-toolchain
Expand Down
3 changes: 2 additions & 1 deletion doc/stream-table-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ dplyr:
- summarise vs. summarize vs. summary


## Related


- [table-object-doc.html](table-object-doc.html)

131 changes: 131 additions & 0 deletions doc/table-object-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
in_progress: yes
default_highlighter: oils-sh
body_css_class: width50
---

Tables, Object, and Documents - Notation, Query, Creation, Schema
=============================

<style>
thead {
background-color: #eee;
font-weight: bold;
text-align: left;
}
table {
font-family: sans-serif;
border-collapse: collapse;
}

tr {
border-bottom: solid 1px;
border-color: #ddd;
}

td {
padding: 8px; /* override default of 5px */
}
</style>

This is part of **maximal** YSH!

<div id="toc">
</div>

## Tables


<table>

- thead
- Data Type
- Notation
- Query
- Creation
- Schema
- tr
- Table
- TSV, CSV
- csvkit, xsv, awk-ish, etc. <br/>
SQL, Data Frames
- ?
- ?
- tr
- Object
- JSON
- jq <br/>
JSONPath: MySQL/Postgres/sqlite support it?
- jq
- JSON Schema
- tr
- Document
- HTML5, XML
- DOM API like getElementById() <br/>
CSS selectors <br/>
XPath?
- JSX Templates
- XML Schema?

<!-- TODO: ul-table should allow caption at the top -->
<caption>Existing</caption>

</table>

&nbsp;

<table>

- thead
- Data Type
- Notation
- Query
- Creation
- Schema
- In-Memory
- tr
- Table
- TSV8 (is valid TSV)
- dplyr-like Data Frames <br/>
Maybe some SQL-pipe subset thing?
- `table { }`
- ?
- By column: dict of "arrays" <br/>
By row: list of dicts <br/>
- tr
- Object
- JSON8 (superset)
- JSONPath? <br/>
jq as a reshaping language
- Hay? `Package { }`
- JSON Schema?
- List and Dict
- tr
- Document
- HTM8 (subset)
- CSS selectors
- Markaby Style `div { }` <br/>
"sed" style
- ?
- DocFrag - a span within a doc<br/>
DocTree - an Obj representation<br/>
?

<caption>Oils</caption>

</table>

## Note: SQL Databases Support all three models!

- sqlite, MySQL, and PostGres obviously have tables
- They all have JSON and JSONPath support!
- JSONPath syntax might differ a bit?
- XML support
- Postgres: XML type, XPath, more
- MySQL: XML extraction functions only
- sqlite: none

## Related

- [stream-table-process.html](stream-table-process.html)
- [ysh-doc-processing.html](ysh-doc-processing.html)
4 changes: 4 additions & 0 deletions doc/ysh-doc-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ Safe HTML subset
}

If you want to take user HTML, then you first use an HTML5 -> HT8 converter.

## Related

- [table-object-doc.html](table-object-doc.html)

0 comments on commit 986fbea

Please sign in to comment.