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

implemenation for mysql storage #96

Merged
merged 1 commit into from
Oct 26, 2023
Merged

implemenation for mysql storage #96

merged 1 commit into from
Oct 26, 2023

Conversation

mattn
Copy link
Collaborator

@mattn mattn commented Oct 22, 2023

  • need to fix tag operations

@mattn
Copy link
Collaborator Author

mattn commented Oct 23, 2023

Works fine for me.

$ nak event -t p=hoge -t e=moge -c "ほげほげ" ws://127.0.0.1:7447
{"id":"00cc8368a849a64b65263947e61c33fabebf48867b21c3a8db84d037702a3546","pubkey":"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","created_at":1698066305,"kind":1,"tags":[["p","hoge"],["e","moge"]],"content":"hello from the nostr army knife","sig":"fddb15819d3c4415876592be7dd517cfa19fed4676324c0950ff0d4ca66f8fb030872f76761adbdefbcf31ef197d006cd0905d2864dbcc22b6dd3a15039f3f9a"}
publishing to ws://127.0.0.1:7447... success.

$ nak req -t e=moge ws://127.0.0.1:7447
{"id":"1a77fe08239ff54293b84f03f4a94d1763548dc5d946ae0bc9b8ef4b4d9adb1a","pubkey":"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","created_at":1698066316,"kind":1,"tags":[["p","hoge"],["e","moge"]],"content":"ほげほげ","sig":"1f2e058ead34119806ab13048f5ad27aed42a6bb78a4e5e494fb6dce9fd6df55496c7a83dca4ba2636c54d9f6962260570fcade46d0ca2f2c0805435ebd3bd7e"}

@mattn
Copy link
Collaborator Author

mattn commented Oct 23, 2023

deleting

$ nak event -k 5 -e 1a77fe08239ff54293b84f03f4a94d1763548dc5d946ae0bc9b8ef4b4d9adb1a ws://127.0.0.1:7447
{"id":"1bfec8ad240fa51b72442df64b17a1cedbaf6461d374fe9b0e50a1b0fcd27eb3","pubkey":"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","created_at":1698066942,"kind":5,"tags":[["e","00cc8368a849a64b65263947e61c33fabebf48867b21c3a8db84d037702a3546"]],"content":"hello from the nostr army knife","sig":"50cec4c70547f15a11b08c2e150361932206fa2dc780b43ea34a03f4731b4e6586996d46c8946e68a1ca6cf19990da47ba2c4b9b67a7488b2d59b2e611604430"}
publishing to ws://127.0.0.1:7447... sent.

$ nak req -t e=moge ws://127.0.0.1:7447

Comment on lines +36 to +38
err := rows.Scan(&evt.ID, &evt.PubKey, &timestamp,
&evt.Kind, &evt.Tags, &evt.Content, &evt.Sig)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err := rows.Scan(&evt.ID, &evt.PubKey, &timestamp,
&evt.Kind, &evt.Tags, &evt.Content, &evt.Sig)
if err != nil {
if err := rows.Scan(&evt.ID, &evt.PubKey, &timestamp,
&evt.Kind, &evt.Tags, &evt.Content, &evt.Sig); err != nil {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep this because this line already too long.

@mattn mattn merged commit 8c7e162 into fiatjaf:master Oct 26, 2023
@mattn mattn changed the title [WIP] experimental implemenation for mysql storage implemenation for mysql storage Oct 26, 2023
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.

2 participants