Closed MattNguyen closed 5 years ago
Hi Matt,
I haven’t given much thought to an offline workflow. Since Data API doesn’t require connections from a VPC, you can call it directly when you run your application locally. However, since it’s just straight SQL (for the most part), it would be possible to have an “offline” mode that falls back to a standard mysql
module connecting to localhost
.
Thanks for the suggestion, Jeremy
This would be an awesome feature. I started to develop something similar to an offline interface. I was wondering between some viable approaches:
I really like it working alongside SLS offline, but it would not work for people that aren't using the serverless framework, thus IMO the last two options are what I'm most inclined to create.
What do you guys think?
@matuella serverless plugin seems cool
However, since it’s just straight SQL (for the most part), it would be possible to have an “offline” mode that falls back to a standard
mysql
module connecting tolocalhost
.
Has this been given any more thought, also without the use of the Serverless
framework? A fallback to a regular MySQL instance would definitely enhance the developer experience of working with Aurora Serverless.
There is a project that can be used to do local Data API development, project can be found here: https://github.com/koxudaxi/local-data-api
However, this does not work out of the box with data-api-client. With the local-data-api you need to config AWS SDK to allow http endpoint, with the current data-api-client setup you'll get this error:
NetworkingError: Protocol "http:" not supported. Expected "https:"
I might open a PR for this to work, one workaround is to add a http: boolean parameter that can be used to allow localhost endpoint.
PR created for this, https://github.com/jeremydaly/data-api-client/pull/26
This was merged. Will release shortly.
Seems like this client could work nicely with serverless-offline as an interface to a local mysql instance.
How would you recommend using data api locally? Do you have any plans on supporting serverless-offline?