Hi, I am new to SST so I followed the Guide book ...
# sst
s
Hi, I am new to SST so I followed the Guide book to create the Notes app which worked fine. However when I created a new table and built new API for the new table, the API for the new table works fine, but now I don’t have access to the Notes API anymore. Is there a specific way we need to organize our apiStack to handle API calls in different tables?
t
can you explain more what you mean by not having access to your api?
if you moved it to a different stack it will have been recreated and have a new url
s
@thdxr after doing more investigation, it seems like the app is using a single-table design that's why I am only able to access APIs of one table. Now I am looking for a way to hand multiple tables.
t
generally you should try to stick to a single table
if you need to use multiple tables that shouldn't be a problem, just pass in another env variable for your second table and reference it in your api calls
s
@thdxr my project is to build an E-commerce with different vendors. So do you think single-table is suitable for this or? I am new to this single table idea.
t
if you're new to dynamo I'd recommend sticking to a single table and learning about single table design - this is a good library which implements the ideas behind it: https://github.com/tywalch/electrodb
you'd make sure all your partition keys include vendor_id in them so the data is separate
s
Thanks, I appreciate it