## Thoughts re [notes/content-layer](/content/notes/content-layer/index.html)

Follow up to [sqlite-content-layer-idea#SQL(ite) Content Layer idea](/content/blog/archive/sqlite-content-layer-idea#sqlite-content-layer-idea/index.html)

- **Situation**: using contentlayer.dev
- **Complication**: contentlayer.dev has various issues for us
  - very basic "db" and hence query
  - focus is typescript type descriptors for types

### What is our needs?

- index our markdown with enough structure to support (in increasingly demandingness)
  - frontmatter
  - backlinks
  - extracted tasks
  - dataview level queries

## Re [notes/obsidian-database-research](/content/notes/obsidian-database-research/index.html) and [notes/obsidian-dataview](/content/notes/obsidian-dataview/index.html)

### Discussion board message on obsidian-dataview

[https://github.com/blacksmithgu/obsidian-dataview/discussions/1811](https://github.com/blacksmithgu/obsidian-dataview/discussions/1811)

First, massive appreciation for this plugin. 🙏

I'm trying to understand if one can use dataview indexing and database _outside_ of Obsidian (more context below). Talking here about _reading_ i.e. accessing the index and doing queries. _Not_ about any rendering of dataview blocks etc..

Related to that, trying to understand a bit more about overall design/architecture of dataview and how it would support this or not.

Note: have done quite a bit of digging around the code and the discussions before asking - apologies if we missed something obvious! 🙏

### Three main questions

1. Can you access dataview (and obsidian) API _outside_ of the running obsidian app?
2. If there is no direct API access what about direct accessing the DB itself? That would
3. Is there a way to reuse the _indexing_ code itself outside of the plugin? i.e. could you use the dataview code _outside_ of obsidian to index markdown files and build a database?

More specific related sub-questions are things like:

- do you create your own index or write to obsidian main index?
- where is the structure of the index documented? (e.g. the "tables" and "columns" - of course, indexeddb is key/value not table based but you know what i mean).

### Comments

We have done a bit of digging around the code. So far, our investigation suggests this is not possible e.g. core functions like [parsePage](https://github.com/blacksmithgu/obsidian-dataview/blob/245208aec9f8116ee3af351d52518637dee128d1/src/data-import/markdown-file.ts#L13) seem to depend on being passed items from obsidian core database e.g. `CachedMetadata`. Is that right?

Is there anyway to access an obsidian database _outside_ of obsidian (I've looked at this before and not found an answer [https://flowershow.app/notes/obsidian-database-research](/content/notes/obsidian-database-research/index.html))

### Our Context

To give context, we're working on [Flowershow](/content/site-root.html), which is an open source tool for publishing markdown and digital gardens especially obsidian. Our tool is React/NextJS based and renders to static content.

When rendering your digital garden to html we need to build an index of the content to prep for rendering.

At the moment, we're having to "reinvent the wheel" in terms of creating our own "content layer" API over the markdown content.

Obviously, obsidian and especially this plugin already do an excellent job of indexing markdown content and extracting metadata including backlinks. We'd love to reuse that work rather than have to rewrite.

In a perfect world, we could reuse obsidian and dataview API _outside_ of obsidian to directly access the indexed content and metadata.

Bonus: if we could access dataview somehow we could even render dataview queries on publishing which would be awesome (see [our issue](https://github.com/flowershow/flowershow/issues/170)) 🚀

## Misc

[https://github.com/aidenlx](https://github.com/aidenlx) proposed sqlite3 backend for data core [https://github.com/blacksmithgu/datacore/issues/6](https://github.com/blacksmithgu/datacore/issues/6)
