-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The spec now lives on rfcs.pgxn.org. Update the README to reflect that this project now contains the pgxn_meta rust crate, rather than the spec.
- Loading branch information
Showing
4 changed files
with
88 additions
and
925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,79 @@ | ||
PGXN Meta Spec | ||
============== | ||
PGXN Meta   [![license-badge]][license] [![ci-badge]][ci] [![cov-badge]][cov] [![deps-badge]][deps] | ||
========= | ||
|
||
[![PostgreSQL License](https://img.shields.io/badge/License-PostgreSQL-blue.svg)](https://opensource.org/licenses/PostgreSQL "⚖️ PostgreSQL License") | ||
[![Build Status](https://github.com/pgxn/meta/actions/workflows/test-and-lint.yml/badge.svg)](https://github.com/pgxn/meta/actions/workflows/test-and-lint "🧪 Test and Lint") | ||
[![Code Coverage](https://codecov.io/gh/pgxn/meta/graph/badge.svg?token=5DOLLPIHEO)](https://codecov.io/gh/pgxn/meta "📊 Code Coverage") | ||
**The pgxn_meta crate provides [PGXN Meta Spec] validation** | ||
|
||
The PGXN Meta Spec defines the requirements for the metadata file | ||
(`META.json`) file for [PGXN] source distribution packages. | ||
--- | ||
|
||
**[The specification can be found here](spec.md).** | ||
The [PGXN Meta Spec] defines the requirements for the metadata file | ||
(`META.json`) file for [PGXN] source distribution packages. This project | ||
provides Rust a crates for working with spec `META.json` files. | ||
|
||
## Contributing | ||
Example | ||
------- | ||
|
||
Development of the spec takes place in the GitHub [pgxn/pgxn-meta-spec] | ||
repository. | ||
<details> | ||
<summary>Click to show `Cargo.toml`.</summary> | ||
|
||
[Issues](/pgxn/pgxn-meta-spec/issues) are used for bugs and actionable items. | ||
Longer discussions take place via [chat](#chat). | ||
|
||
The specification and code is licensed under the PostgreSQL license found in | ||
the [`LICENSE.md`](LICENSE.md) file in this repository. | ||
|
||
Typos and grammatical errors can go straight to a pull-request. When in doubt, | ||
start on the [mailing-list](#mailing-list). | ||
|
||
### Testing | ||
|
||
This project includes test written in [Rust]. Use this command to install | ||
Rust: | ||
|
||
``` sh | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
```toml | ||
[dependencies] | ||
serde_json = "1.0" | ||
pgxn_meta = "0.1" | ||
``` | ||
</details> | ||
|
||
``` rust | ||
use serde_json::json; | ||
use pgxn_meta::*; | ||
|
||
func main() { | ||
// Parse the contents of a META.json file into a serde_json Value | ||
let meta = json!({ | ||
"name": "pair", | ||
"abstract": "A key/value pair data type", | ||
"version": "0.1.8", | ||
"maintainer": "theory <[email protected]>", | ||
"license": "postgresql", | ||
"provides": { | ||
"pair": { | ||
"file": "sql/pair.sql", | ||
"version": "0.1.8" | ||
} | ||
}, | ||
"meta-spec": { "version": "1.0.0" } | ||
}); | ||
|
||
// Validate the META.json contents. | ||
let mut validator = Validator::new(); | ||
if let Err(e) = validator.validate(&meta) { | ||
panic!("Validation failed: {e}"); | ||
}; | ||
} | ||
``` | ||
|
||
Once it's installed, run tests with `make test`. | ||
|
||
### Linting | ||
Contributing | ||
------------ | ||
|
||
This project uses [pre-commit] to keep the code tidy and warning and | ||
error-free. Install [pre-commit], use `make lint` to run the linters, and | ||
`make .git/hooks/pre-commit` to force pre-commit to run before every commit. | ||
We welcome community contributions to this project. All contributors must | ||
abide by the [PostgresSQL Code of Conduct]. | ||
|
||
## Chat | ||
* Create [Issues] to submit bug reports and feature requests | ||
* Submit [Pull Requests] to fix issues or add features | ||
|
||
PGXN discussion happens in the following chat rooms: | ||
License | ||
------- | ||
|
||
* [PGXN Discussions] (best for design discussions) | ||
* `#extensions` channel on [Postgres Slack] | ||
* `#extension-discuss` channel on [Postgres Discord] | ||
This project is distributed under the [PostgreSQL License][license]. | ||
|
||
[license-badge]: https://img.shields.io/badge/License-PostgreSQL-blue.svg | ||
[license]: https://opensource.org/licenses/PostgreSQL "⚖️ PostgreSQL License" | ||
[ci-badge]: https://github.com/pgxn/meta/actions/workflows/test-and-lint.yml/badge.svg | ||
[ci]: https://github.com/pgxn/meta/actions/workflows/test-and-lint "🧪 Test and Lint" | ||
[cov-badge]: https://codecov.io/gh/pgxn/meta/graph/badge.svg?token=5DOLLPIHEO | ||
[cov]: https://codecov.io/gh/pgxn/meta "📊 Code Coverage" | ||
[deps-badge]: https://deps.rs/repo/github/pgxn/meta/status.svg | ||
[deps]: https://deps.rs/repo/github/pgxn/meta "📦 Dependency Status" | ||
[PGXN Meta Spec]: https://rfcs.pgxn.org/0001-meta-spec-v1.html | ||
[PGXN]: https://pgxn.org "PGXN: PostgreSQL Extension Network" | ||
[pgxn/pgxn-meta-spec]: https://github.com/pgxn/pgxn-meta-spec | ||
[Rust]: https://www.rust-lang.org "The Rust Programming Language" | ||
[pre-commit]: https://pre-commit.com "A framework for managing and maintaining multi-language pre-commit hooks." | ||
[Postgres Slack]: https://pgtreats.info/slack-invite | ||
[Postgres Discord]: https://discord.com/invite/bW2hsax8We | ||
[PGXN Discussions]: https://github.com/orgs/pgxn/discussions/ | ||
[PostgresSQL Code of Conduct]: https://www.postgresql.org/about/policies/coc/ | ||
[Issues]: https://github.con/pgxn/meta/issues |
Oops, something went wrong.