Skip to content

Conversation

@egormanga
Copy link
Contributor

Description of Changes

For a table like this:

#[table]
struct User {
	#[primary_key]
	id: Identity
}

generates a type like that:

#[allow(dead_code)]
#[derive(SpacetimeType)]
struct UserId(Identity);

impl std::borrow::Borrow<Identity> for UserId {
	fn borrow(&self) -> &Identity {
		&self.0
	}
}

Yet to make it treat the type as Identity. Perhaps a trait is needed instead of a newtype.

API and ABI breaking changes

TBD.

Expected complexity level and risk

TBD.

Testing

  • Module compiles
  • Module publishes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typesafe primary keys

1 participant