Skip to content

Commit

Permalink
add autogen action status badge
Browse files Browse the repository at this point in the history
  • Loading branch information
lonng committed May 17, 2024
1 parent fc69ac7 commit 461a9ad
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 37 deletions.
61 changes: 34 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![README autogen](https://github.com/lonng/db-papers/actions/workflows/autogen.yml/badge.svg)](https://github.com/lonng/db-papers/actions/workflows/autogen.yml)

---

# Database Papers

This is a comprehensive list of papers on database theory for understanding and building database systems. It covers various aspects of database systems, including the essential theoretical background, classic system design, and multiple modules within the database.
Expand All @@ -21,33 +25,36 @@ Any contribution that can help improve this list and make it more comprehensive

## Table of Contents

- [Basics](#basics)
- [Essentials](#essentials)
- [Consensus](#consensus)
- [Consistency](#consistency)
- [System Design](#system-design)
- [RDBMS](#rdbms)
- [NoSQL](#nosql)
- [SQL Engine](#sql-engine)
- [Optimizer Framework](#optimizer-framework)
- [Transformation](#transformation)
- [Nested Query](#nested-query)
- [Functional Dependencies](#functional-dependencies)
- [Join Order](#join-order)
- [Cost Model](#cost-model)
- [Statistics](#statistics)
- [Probabilistic Counting](#probabilistic-counting)
- [Execution Engine](#execution-engine)
- [MPP Optimizations](#mpp-optimizations)
- [Storage Engine](#storage-engine)
- [Storage Structure](#storage-structure)
- [Transaction](#transaction)
- [Scheduling](#scheduling)
- [Miscellaneous](#miscellaneous)
- [Workload](#workload)
- [Network](#network)
- [Quality](#quality)
- [Diagnosis and Tuning](#diagnosis-and-tuning)
- [Database Papers](#database-papers)
- [Contribution](#contribution)
- [Table of Contents](#table-of-contents)
- [Basics](#basics)
- [Essentials](#essentials)
- [Consensus](#consensus)
- [Consistency](#consistency)
- [System Design](#system-design)
- [RDBMS](#rdbms)
- [NoSQL](#nosql)
- [SQL Engine](#sql-engine)
- [Optimizer Framework](#optimizer-framework)
- [Transformation](#transformation)
- [Nested Query](#nested-query)
- [Functional Dependencies](#functional-dependencies)
- [Join Order](#join-order)
- [Cost Model](#cost-model)
- [Statistics](#statistics)
- [Probabilistic Counting](#probabilistic-counting)
- [Execution Engine](#execution-engine)
- [MPP Optimizations](#mpp-optimizations)
- [Storage Engine](#storage-engine)
- [Storage Structure](#storage-structure)
- [Transaction](#transaction)
- [Scheduling](#scheduling)
- [Miscellaneous](#miscellaneous)
- [Workload](#workload)
- [Network](#network)
- [Quality](#quality)
- [Diagnosis and Tuning](#diagnosis-and-tuning)

## Basics

Expand Down
39 changes: 29 additions & 10 deletions autogen/autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Any contribution that can help improve this list and make it more comprehensive
- **Remove a paper**: If you think a paper is no longer relevant or useful, please file an issue to suggest its removal.
- **General suggestions**: If you have any general suggestions or feedback on how to improve this list, please file an issue to share your thoughts.`

var badges = []string{
"[![README autogen](https://github.com/lonng/db-papers/actions/workflows/autogen.yml/badge.svg)](https://github.com/lonng/db-papers/actions/workflows/autogen.yml)",
}

type (
options struct {
addrFormat string
Expand Down Expand Up @@ -165,30 +169,45 @@ func convert(opt *options) error {
})
}

var output string
generate := func(s string, newline int) {
output += s + strings.Repeat("\n", newline)
}

// Generate Badges if exists
if len(badges) > 0 {
for _, badge := range badges {
generate(badge, 1)
}
generate("", 1)
generate("---", 2)
}

// Generate Title and Description
output := fmt.Sprintf("# %s\n\n%s\n\n", opt.title, opt.description)
generate(fmt.Sprintf("# %s", opt.title), 2)
generate(opt.description, 2)

// Generate Table Of Contents
output += "## Table of Contents\n\n"
generate("## Table of Contents", 2)
for _, s := range sections {
output += fmt.Sprintf("- [%s](#%s)\n", s.name, strings.ToLower(strings.ReplaceAll(s.name, " ", "-")))
generate(fmt.Sprintf("- [%s](#%s)", s.name, strings.ToLower(strings.ReplaceAll(s.name, " ", "-"))), 1)
for _, m := range s.modules {
output += fmt.Sprintf(" - [%s](#%s)\n", m.name, strings.ToLower(strings.ReplaceAll(m.name, " ", "-")))
generate(fmt.Sprintf(" - [%s](#%s)", m.name, strings.ToLower(strings.ReplaceAll(m.name, " ", "-"))), 1)
}
}

// Add a new line
output += "\n"
generate("", 1)

padding := func(space int) string {
return strings.Repeat(" ", space)
}

// Generate Sections
for _, s := range sections {
output += fmt.Sprintf("## %s\n\n", s.name)
generate(fmt.Sprintf("## %s", s.name), 2)
for _, m := range s.modules {
output += fmt.Sprintf("### %s\n\n", strings.ReplaceAll(m.name, ":", " -"))
generate(fmt.Sprintf("### %s", strings.ReplaceAll(m.name, ":", " -")), 2)
// Sort all records by year
sort.Slice(m.records, func(i, j int) bool {
return m.records[i].year < m.records[j].year
Expand Down Expand Up @@ -252,13 +271,13 @@ func convert(opt *options) error {
}

if local != "" {
output += fmt.Sprintf("- [%s](%s) (%s) - %s\n", r.title, local, r.year, r.authors)
generate(fmt.Sprintf("- [%s](%s) (%s) - %s", r.title, local, r.year, r.authors), 1)
} else {
output += fmt.Sprintf("- [%s](%s) (%s) - %s\n", r.title, r.url, r.year, r.authors)
generate(fmt.Sprintf("- [%s](%s) (%s) - %s", r.title, r.url, r.year, r.authors), 1)
}

if i == len(m.records)-1 {
output += "\n"
generate("", 1)
}
}
}
Expand Down

0 comments on commit 461a9ad

Please sign in to comment.