Skip to content

Commit

Permalink
Release/0.3.0 (#16)
Browse files Browse the repository at this point in the history
* remove improper categories

* make the generated builder infallible, but lose new/default.

* remove use/import of traits.

* absorb QueryFields into Entity (fewer use statements for users)

* remove node/relation shorthand attributes

* rename attr: stamps -> timestamps

* update examples, test, clippy

* build and test the workspace

* rename ci action so its more descriptive in the badge

* rename Entity to FieldSet, so it's more clear it is more abstract

* wip changing readme

* add/move scripts

* rename as_query* to to_query* because it's not free

* add as_query_fields and as_query_obj, static query string that ignores timestamps

* rename fn

* write a bunch of test fragments as includes

* fix var used

* upgrade and sort deps

* update devcontainer to use my prebuilt rust image

* update scripts

* fix neo4rs usage (breaking in 0.7), run ./fix.sh

* run ./fix.sh

* prevent clippy from removing pub use that is actually used in the tests.

* need to add the 1.0 tag to dockerfile (no latest)

* merge changes from 'breaking 0.7' branch

* update readmes, changelog, and bump version

* bump macros version
  • Loading branch information
jifalops authored Mar 1, 2024
1 parent 2f09086 commit aa99a9b
Show file tree
Hide file tree
Showing 60 changed files with 1,123 additions and 686 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mcr.microsoft.com/devcontainers/rust:bookworm
FROM jifalops/rust:1.0
7 changes: 2 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
"name": "Cypher DTO",
"dockerComposeFile": "./docker-compose.yml",
"service": "app",
"remoteUser": "developer",
"workspaceFolder": "/cypher-dto",
"postCreateCommand": ".devcontainer/post-create.sh",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"JScearcy.rust-doc-viewer",
"serayuzgur.crates",
"tamasfe.even-better-toml"
]
}
Expand Down
5 changes: 5 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ services:
volumes:
- ..:/cypher-dto:cached
environment:
PROJECT_ROOT: /cypher-dto
GITHUB_TOKEN: ${GITHUB_TOKEN}
TZ: ${TZ}
NEO4J_TEST_URI: "bolt://db:7687"
NEO4J_TEST_USER: "neo4j"
NEO4J_TEST_PASS: "developer"

db:
image: neo4j:5
Expand Down
10 changes: 2 additions & 8 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Ensure devcontainer user owns the project directory
sudo chown -R vscode:vscode /cypher-dto
sudo chown -R developer:developer $PROJECT_ROOT

# Remember history on the local machine
ln -s /cypher-dto/.devcontainer/.bash_history ~/.bash_history
ln -s $PROJECT_ROOT/.devcontainer/.bash_history ~/.bash_history

# Install dotfiles
gh repo clone dotfiles ~/dotfiles && ~/dotfiles/install.sh

# rustup and cargo bash completion.
sudo apt-get update -qq && sudo apt-get install -y -qq --no-install-recommends bash-completion \
&& mkdir -p ~/.local/share/bash-completion/completions \
&& rustup completions bash > ~/.local/share/bash-completion/completions/rustup \
&& rustup completions bash cargo > ~/.local/share/bash-completion/completions/cargo
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rust

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
26 changes: 0 additions & 26 deletions .github/workflows/rust.yml

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change log

## v0.3.0

- Upgrade to neo4rs 0.7.1
- Add a .devcontainer for easy development and contribution.
- Breaking: remove #[node] and #[relation] attributes
- Breaking: renamed the #[stamps] attribute to #[timestamps]
- Breaking: rename derive macros to `Node` and `Relation`.
- Breaking: renamed `as_query_fields()` to `to_query_fields()` and added a parameterless `as_query_fields()` that returns a static string.
- Breaking: renamed `as_query_obj()` to `to_query_obj()` and added a parameterless `as_query_obj()` that returns a static string.
- Breaking: the generated builder struct is now infallible. They no longer have `new()` or `default()` methods.
This is a better fit for the intended use case, modifying an existing entity.
- `Entity` and `QueryFields` have been combined into one struct named `FieldSet`. This is not breaking for macros/derive, but is breaking if you were implementing them manually.
- Share some tests between docs and code.

## v0.2.0

- Fix handling of Option types in getters and parameters (#2)
Expand Down
Loading

0 comments on commit aa99a9b

Please sign in to comment.