Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tx query from context #28

Merged
merged 2 commits into from
Mar 4, 2025
Merged

tx query from context #28

merged 2 commits into from
Mar 4, 2025

Conversation

marino39
Copy link
Contributor

@marino39 marino39 commented Mar 4, 2025

No description provided.

@marino39 marino39 force-pushed the db-query-from-context branch from 2d2e3b9 to 5dac22d Compare March 4, 2025 09:33
@marino39 marino39 force-pushed the db-query-from-context branch from 5dac22d to 6377c57 Compare March 4, 2025 11:01
@marino39
Copy link
Contributor Author

marino39 commented Mar 4, 2025

Use example:

collections.go

func (t *assetsTable) GetByCollectionIDTokenIDs(ctx context.Context, collectionID uint64, tokenIDs []prototyp.BigInt) (map[string]Assets, error) {
	querier := t.db.TxQueryFromContext(ctx)
	if querier == nil {
		querier = t.db.Query
	}
        ...
}

@pkieltyka pkieltyka merged commit dd68239 into master Mar 4, 2025
1 check passed
@pkieltyka pkieltyka deleted the db-query-from-context branch March 4, 2025 13:39
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.

None yet

3 participants