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

Support standard naming conventions for databases #135

Closed
nsjames opened this issue Apr 11, 2023 · 3 comments · Fixed by #179
Closed

Support standard naming conventions for databases #135

nsjames opened this issue Apr 11, 2023 · 3 comments · Fixed by #179
Assignees
Labels
enhancement New feature or request 👍 lgtm
Milestone

Comments

@nsjames
Copy link
Contributor

nsjames commented Apr 11, 2023

Right now we are using emplace, modify, and erase for the manipulation of rows in multi_index tables.

Since we are expecting multi_index to be used in a similar way to a database within smart contracts, it would be easier for developers to get started with Antelope if our nomenclature mimicked that of other databases they are familiar with (like MySQL, Postgre, MongoDB, SQLite, etc) and had alias support for:

  • Insert
  • Update
  • Delete

I think that the understandability and memorability of our language would improve for anyone who doesn't come from C++, Rust, or D.

users.insert(ram_payer, [&](auto& row){ ... });
users.update(user, ram_payer, [&](auto& row){ ... });
users.delete(user);
@nsjames nsjames changed the title Support standard naming conventions for storage mechanisms Support standard naming conventions for databases Apr 11, 2023
@stephenpdeos stephenpdeos added the enhancement New feature or request label Apr 19, 2023
@stephenpdeos stephenpdeos added this to the CDT 5.0.0-rc1 milestone Apr 19, 2023
@mikelik mikelik self-assigned this May 15, 2023
@mikelik mikelik moved this from Todo to In Progress in Team Backlog May 15, 2023
@mikelik
Copy link
Contributor

mikelik commented May 16, 2023

@nsjames delete is a restricted keyword in C++ and cannot be used. May I use remove instead?

@mikelik mikelik moved this from In Progress to Awaiting Review in Team Backlog May 17, 2023
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Team Backlog May 18, 2023
@mikelik
Copy link
Contributor

mikelik commented May 18, 2023

Added insert, update and remove

@nsjames
Copy link
Contributor Author

nsjames commented Jun 20, 2023

Heyy, I didn't even notice this. That's awesome 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 👍 lgtm
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants