Giter Club home page Giter Club logo

Comments (4)

mobsense avatar mobsense commented on July 21, 2024

Thanks for the excellent issue description. I can reproduce this and will get back to you with diagnosis soon.

from dynamodb-onetable.

mobsense avatar mobsense commented on July 21, 2024

Okay, diagnosed this issue.

The core issue is the handling of value templates was not taking into account dependent fields. i.e. the UUID needed to be generated before preparing the PK field. The fix is to calculate the order of dependencies in the properties and to calculate the property values according to that order.

There was an associated issue with create when a PK/SK is not fully provided in the API properties.

We'll add a samples directory with a sample modeled on your bug code for verification.

See latest commit for the fix and for the samples/crud

Fixed in 1.4.2

from dynamodb-onetable.

mobsense avatar mobsense commented on July 21, 2024

FYI: DynamoDB won't let you write empty strings.

So

 gs1sk:       { type: String, value: '' },

Should always have a non-empty value.

Also, if you prefer, once defining the UUID in the table, each field can use

uuid: true

to use the Table level setting, which you set to 'ulid'.

Last tip, define a logger to see the actual generated DynamoDB code.

Add this to your Table params:

    logger: (type, message, context) => {
        if (type == 'trace' || type == 'data') return
        console.log(type, message, JSON.stringify(context, null, 4))
    }

from dynamodb-onetable.

ericmarcos avatar ericmarcos commented on July 21, 2024

@mobsense Thanks for the quick fix! I just tested it and it works now =)

I've applied your tips as well, however now I'm facing a new problem: I can't create a Table from my app. I used to create the table via CLI before, but I'd like to do it all programatically.
I've opened a new issue (#43) for this so I'm closing this one.

from dynamodb-onetable.

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.