Skip to content

v0.1.0-dev.4: Custom Apis, Unique Views, WebAssembly

Pre-release
Pre-release
Compare
Choose a tag to compare
@ecton ecton released this 23 Jun 23:45
· 899 commits to main since this release
5685909

Welcome to the first release on GitHub. I wanted to take this moment to talk a little bit about the development of this project.

I've added a CHANGELOG.md. I may not do much to highlight breaking changes this early on in development, but once we have a 0.1.0 release, I'll start tracking breaking changes. At this point, PliantDb is purely experimental, and while I applaud anyone attempting to use it, using it this early will likely break as I continue to develop the API.

For the near future, I want the flexibility to change drastic things without worrying about how it impacts existing user's code. Until we have a successful decent-sized project using PliantDb, I think it's impossible to be confident everything is designed well.

Lastly, I wanted to mention that this year seems to just fly by. I hadn't realized it was April 26 when the last release happened. I have a goal to get a new version of Cosmic Verge running on PliantDb, but we are ambitious. In the process, we are redoing our presentation layer. As such, it may have looked like I lost interest in this project and moved on.

Fear not, this project is near and dear to my heart, which is why the first product of the Gooey project is this example which shows how to build a simple Gooey app and PliantDb server with a basic custom API. Because of the new support for WebAssembly, the example even works in a modern browser.

If you have any questions or feedback, feel free to join the discussion on our Discourse forums.

From the CHANGELOG

Added

  • View::unique() has been added, allowing for a View to restrict saving documents when multiple documents would end up with the same key emitted for this view. For example, if you have a User collection and want to ensure each User has a unique email_address, you could create a View with the key of email_address and return true from unique(), and PliantDb will enforce that constraint.

  • Permissions support has been added across the platform with granular access. The pliantdb::core::permissions module contains the data types involved. More documentation and examples are to-come -- users and roles haven't been added yet.

  • The initial underpinnings of customizing the PliantDb server have been added. First, there's the Backend trait. Right now, its only purpose is to allow defining a CustomApi. This allows applications built with PliantDb to extend the network protocol with Request and Response types that just need to support serde. For a full example, check out this in-development Gooey example.

  • An initial version of a WebAssembly client is now supported. It only supports WebSockets. While there has been news of QUIC support in the browser, it's a limited implementation that only exposes an HTTP protocol. As such, it is incompatible with the PliantDb protocol. Eventually, we hope to support WebRTC as an alternative to TCP in WebAssembly. The example linked in the previous bullet point can be built and loaded in a browser.