Git Product home page Git Product logo

Comments (13)

AshanFernando avatar AshanFernando commented on May 27, 2024

This is a good suggestion. The challenge we need to solve is we need to create the local dynamodb tables also from the defined schema. @jbremmer Any suggestions?

from serverless-dynamodb-local.

jbremmer avatar jbremmer commented on May 27, 2024

Not sure what you mean, I would not want to have two definitions. YAML one is what I would want to work with possibly extending a custom section with seed file pointer.

from serverless-dynamodb-local.

msjonker avatar msjonker commented on May 27, 2024

I've created a branch that uses the serverless.yml Resources section for creation of DynamoDB tables here: https://github.com/msjonker/serverless-dynamodb-local/tree/serverless-config

Unfortunately, since dynamodb-migrations is no longer used, seeding is not available. @AshanFernando if you could provide some feedback, I'd appreciate it.

from serverless-dynamodb-local.

AshanFernando avatar AshanFernando commented on May 27, 2024

@msjonker I think we can replace dynamodb-migrations with a new library called dynamodb-seeds, only with seeds functionality. What do you think?

from serverless-dynamodb-local.

msjonker avatar msjonker commented on May 27, 2024

Thanks for the feedback!

I can't find dynamodb-seeds; did you mean dynamo-seeder? If so, that library depends on a schema file existing for each table that is being seeded, which gets us back to where we were with a separate schema file having to be updated in tandem with the Serverless Resources definition.

To me, it feels that seeding should be separate from this plugin, as seeding could be used both for local or production instance of DynamoDB. It looks like this was attempted at one point in https://github.com/marc-hughes/serverless-dynamodb-fixtures-plugin, but has not been updated to work with Serverless v1+. What is described there is more like I was thinking. I don't use the seeding functionality of serverless-dynamodb-local, but would be willing to see what it takes to get that plugin up-to-date, if you are open to that solution.

from serverless-dynamodb-local.

AshanFernando avatar AshanFernando commented on May 27, 2024

Hi @msjonker, even now serverless-dynamodb-local supports seeding in local as well as production environments. However the feature was missing in the documentation after creating a new branch for the serverless 1.0 version of the plugin. This we could fix easily. @mjzone Will you be able to look into this?

I agree with you. Seeding should be separated from the migration plugin. Since the migration feature is moving to yml, migration plugin is no longer needed. Now migrations more becoming a part of serverless (Previously we wrote functionality as third party plugins if its not depending on serverless structure).

So my proposal is to create a new plugin called dynamodb-seeds extracting the seeding functionality from dynamodb-migrations(Both local and production seeding) and use with serverless-dynamodb-local to make the plugin up-to date with both yml based migrations and seeding functionality.

So shall we move on that directions so that we can update the plugins?

from serverless-dynamodb-local.

msjonker avatar msjonker commented on May 27, 2024

Yep, sounds good!

from serverless-dynamodb-local.

daviskoh avatar daviskoh commented on May 27, 2024

I currently use serverless variables like so

serverless.yaml

resources:
  Resources:
    myTable:
      Type: AWS::DynamoDB::Table
      Properties:
        ${file(./dynamodb/my-table.json):Table}

from serverless-dynamodb-local.

nbransby avatar nbransby commented on May 27, 2024

Where did you guys get to with this work? It seems like the the right approach to take

from serverless-dynamodb-local.

msjonker avatar msjonker commented on May 27, 2024

I believe that the dynamodb-seeds plugin needs to be created. I haven't had a chance to work on that yet.

from serverless-dynamodb-local.

christophgysin avatar christophgysin commented on May 27, 2024

I reviewed, and tested this, works great and looks good!

I rebased it on top of v1, and pushed to my repo. Let me know if I can further help to get this merged.

from serverless-dynamodb-local.

christophgysin avatar christophgysin commented on May 27, 2024

This has been merged, and should be closed.

from serverless-dynamodb-local.

msjonker avatar msjonker commented on May 27, 2024

Resources declaration addressed in #72. Seeding addressed in #77.

from serverless-dynamodb-local.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.