swift-server / swift-aws-lambda-runtime

Swift implementation of AWS Lambda Runtime
Apache License 2.0
1.13k stars 102 forks source link

Database support? #165

Closed crspybits closed 4 years ago

crspybits commented 4 years ago

Hi-- I am really appreciative of this effort for Swift AWS lambda support! Thanks so much.

Please take the following question in that appreciative light and also with the fact that I'm new to AWS lambda and not fully sure of the way it works.

I am wondering if database support will (eventually) be part of this effort or part of some other package? E.g., could one just use database access within Swift AWS lambda code from say Vapor (https://github.com/vapor/vapor) with the swift-aws-lambda-runtime package or would that support have to be tailored to AWS lambda?

Thanks! Chris.

MoridinBG commented 4 years ago

You can use the db directly with https://github.com/vapor/sql-kit and one of the available drivers. I have good success with postgres-kit and a PostgreSQL in Amazon RDS accessed from Swift lambdas.

Fluent is higher level ORM on top of sql-kit and the drivers. You can try that too - https://github.com/vapor/fluent-kit

crspybits commented 4 years ago

Nice! Thanks!

fabianfett commented 4 years ago

I've also used vapor's mysql-kit with Lambda - worked really good!

You could also use the DynamoDB client from the aws-sdk-swift, if you want to use something serverless.

Does this solve your problem? Can we close this issue?

crspybits commented 4 years ago

Yes-- thanks. Closing.