Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nfultz/askgitdbi

a DBI wrapper around askgit
https://github.com/nfultz/askgitdbi

Last synced: about 1 month ago
JSON representation

a DBI wrapper around askgit

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# askgit

This is a very quick DBI wrapper around the most excellent [askgit](https://github.com/askgitdev/askgit)
program, which has an undocumented SQLite extension mode.

**WIP / DO NOT USE FOR CRITICAL JOBS**

## Installation

Ideally one could install the development version of the askgit DBI wrapper via:

``` r
remotes::install_github("nfultz/askgitdbi")
```

However, I have no idea if it would work with submodules. Also you need the
appropriate golang tools as well as libgit2.

## Example

This is a basic example which shows you how to query a repo:

```{r example}
library(DBI)

con <- dbConnect(askgit::AskGit(), ":memory:")

dbGetQuery(con, "select hash, author_name from commits order by committer_when desc limit 3")

```

The below is a less contrived example:

```{r}
require(ggplot2)

"select author_name, count(hash) as n
from commits('../DeclareDesign')
where message not like 'Merge%'
group by 1
order by 2 desc
limit 4" |>
dbGetQuery(conn=con) |>
ggplot() + aes(x=author_name, y=n) + geom_col()

```