Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.
/ mf2sql Public archive

PostgreSQL schema for storing microformats2 JSON objects

License

Notifications You must be signed in to change notification settings

valpackett/mf2sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mf2sql unlicense

A PostgreSQL (10) schema for storing microformats2 objects (as the canonical JSON representation), featuring:

  • Fast storage and querying (jsonb + GIN)
  • Uniqueness constraint on the first url value
  • Full text search
  • Automatic insert/update/delete notifications
  • Denormalization (embed linked objects like replies for exporting into JSON files or rendering to HTML templates)
  • Normalization (un-embed linked objects when importing from JSON files)
  • And more

Setup

  • Create a database e.g. sudo -u postgres createdb mywebsite
  • Run SELECT current_setting('default_text_search_config'); to check if your default language for full text search matches your website's (if not, change that setting)
  • Run the migrations using migrate e.g. migrate -path=migrations -url=postgres://localhost/mywebsite\?sslmode=disable up (or just run the migrations/*.up.sql files with psql if you don't want to bother with migrate) (so far there's only one migration)
  • Install the functions by running psql on functions/*.sql
  • Import JSON files using import.rb if you want

Development

Grab pgTAP (including pg_prove) to run the tests!

Contributing

Please feel free to submit pull requests!

By participating in this project you agree to follow the Contributor Code of Conduct.

The list of contributors is available on GitHub.

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.

About

PostgreSQL schema for storing microformats2 JSON objects

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published