Skip to content

Releases: nodecosmos/charybdis

v0.6.2

05 Jun 14:10
efaa62f
Compare
Choose a tag to compare

What's new:

  • feat: add push/pull if exists methods & constants to collection fields #37

Now for collection fields we get additional push/pull if exists constants and methods

#[charybdis_model(
    table_name = users,
    partition_keys = [id],
    clustering_keys = []
)]
pub struct User {
    id: Uuid,
    tags: Set<Text>,
}

// constants
impl User {
    const PUSH_TAGS_IF_EXISTS_QUERY: &'static str = "UPDATE users SET tags = tags + ? WHERE id = ? IF EXISTS";
    const PULL_POST_IDS_IF_EXISTS_QUERY: &'static str = "UPDATE users SET post_ids = post_ids - ? WHERE id = ? IF EXISTS";
}

// methods
let user = User::new();

user.push_tags_if_exists(tags: HashSet<T>).execute(&session).await;
user.pull_tags_if_exists(tags: HashSet<T>).execute(&session).await;

v0.6.1

30 May 13:13
Compare
Choose a tag to compare

What's new:

  • Panics if Tuple field is not Frozen<Tuple<T, T>> as it can cause migration to drop and recreate field a47be2a

v0.6.0

09 May 18:03
049c9a4
Compare
Choose a tag to compare

What's new:

  • update: scylladb driver version to v0.13.0 #32
  • refactor: require Send + Sync for SerializeRowBox
  • refactor: prevent potential collision with native 'new' methods in partial_models

Potential breaking changes:

  • update: re-export from scylladb only types that are relevant for charybdis-macros & query options

v0.5.3

30 Apr 11:32
5b42809
Compare
Choose a tag to compare

What's new

fix: Batch::chunked_statements - correctly append raw statements to the batch

v0.5.2

26 Apr 17:05
8ce7a5b
Compare
Choose a tag to compare

What's new

fix: field order requirement - now struct fields don't have to be in the same order as they are in macro arguments

v0.5.1

25 Apr 09:51
a58b9b1
Compare
Choose a tag to compare

What's new

  • fix: timeuuid in #28

It fixes: #26

v0.5.0

23 Apr 12:45
Compare
Choose a tag to compare

What's new

  • feat charybdis-migrate: use --verbose flag to print alter table option statements.
  • feat charybdis-migrate: parse all files on migration and generate diff between model definition and database

In the previous versions, migration files were parsed specifically from the src/models directories, and it was necessary to have only one model per file to ensure correct migration processing. However, the updated migration tool has enhanced capabilities. It can now analyze and parse multiple models from a single file, and they can be located in any directory in the project root.

v0.4.18

20 Apr 11:06
da50cdc
Compare
Choose a tag to compare

What's new

  • fix #22 : generate functions based on order defined in macro args

  • perf: use field refs instead of clones for macro parser

  • fix #24: composite partition key materialized view migrations #23

  • fix: query charybdis batch:

    let node = Node {
        id: node_id,
        ..Default::default()
    };
    
    let delete_likes = Like {
        object_id: node_id,
        ..Default::default()
    };
    
    let mut batch = CharybdisBatch::new();
    
    batch
        .append(node.delete())
        .append(delete_likes.delete_by_partition_key())
        .execute(db_session)
        .await?;

v0.4.17

18 Apr 09:50
Compare
Choose a tag to compare

What's new

  • feat#types: add support for Duration #21

  • fix#types: use correct type for Time #21

  • fix#types: use BigDecimal for Decimal

  • fix#migration: schema_json generation

  • fix#finds: require complete partition keys for automatically generated functions a7aa212

  • feat#find: add find by global secondary indexes functions #21

    #[charybdis_model(
        table_name = posts,
        partition_keys = [...],
        clustering_keys = [...],
        global_secondary_indexes = [category_id]
    )]
    pub struct Post {...}
    
    let posts: CharybdisModelStream<Post> = Post::find_by_category_id(category_id).execute(db_session).await?;
    let post: Post = Post::find_first_by_category_id(category_id).execute(db_session).await?;
    let post: Option<Post> = Post::maybe_find_first_by_category_id(category_id).execute(db_session).await?;

v0.4.14

12 Apr 18:00
4e00c64
Compare
Choose a tag to compare

What's new

  • Add static columns #17
#[charybdis_model(
    table_name = user_messages,
    partition_keys = [user_id],
    clustering_keys =  [],
    static_columns = [username, email]
)]
pub struct UserMessage {
    pub user_id: Uuid,
    pub content: Text,
    pub username: Text,
    pub email: Text,
}
  • Improve error handling in parser if macro fields definition are not provided in expected way according to Scylla/Cassandra