Closed nopslip closed 5 months ago
looking spaceandtimesdk.py it looks like maybe the docs are missing resourceId, so I tried this:
from spaceandtimesdk import SpaceAndTimeSDK
from dotenv import load_dotenv
import os
load_dotenv()
# Initializing the Space and Time SDK for use.
SpaceAndTimeInit = SpaceAndTimeSDK()
biscuit = os.getenv("Z_BISCUIT")
query = f"INSERT INTO SE_PLAYGROUND.NFT_METADATA VALUES (9998, 9998, \"https://ipfs.moralis.io:2053/ipfs/QmNdgeo398VHvPgpLw6PddrhHfEQ7fkKj7KGbMt6wmWNNv/1998\", \"Alek_Common_1998\", \"Alek\", \"Common\")"
print(biscuit)
print(query)
dml_data = SpaceAndTimeInit.DML("SE_PLAYGROUND.NFT_METADATA", query, biscuit)
dml_data_response = dml_data["response"]
dml_data_error = dml_data["error"]
print("Response: ", dml_data_response)
print("Error: ", dml_data_error)
Which gives this:
Response: None
Error: 400 Client Error: Bad Request for url: https://api.spaceandtime.app/v1/sql/dml
I will DM you the biscuit so you can see that is has the correct permissions.
Adding single quotes instead of the "/" or double quotes seemed to have worked. I tried it out by creating a separate table and inserting data into it. Here's a Sample Insert statement
INSERT INTO NAMESPACE.TABLENAME VALUES (9996, 9996, 'https://ipfs.moralis.io:2053/ipfs/QmNdgeo398VHvPgpLw6PddrhHfEQ7fkKj7KGbMa6wmWNNv/1998', 'Jez_Common_1992', 'Jez', 'Rare')
Thank you, @gssakash-SxT. I think now we just need to get the docs updated include the resourceId
in the function call and we can close this.
using the following example from the docs:
as a script like this:
I get the following error: