GithubHelp home page GithubHelp logo

Comments (6)

jed avatar jed commented on May 27, 2024

this library is node-only, which means all we need to do is confirm to v8's handling, which iterates in insertion order EXCEPT when numbers are used as keys. that's really the only case where i could see this fail, and it is pretty rare. providing a dead-easy API with a fallback to the original raw API for when this isn't good enough is a pretty good compromise, i think, but am willing to entertain pull requests that add the ability to use arrays without affecting the current API.

from dynamo.

 avatar commented on May 27, 2024

I asked about this on StackOverflow, and opinion seems to be against doing this for node libraries. I think the problem arises when (for performance reasons), V8 decides to change its implementation. Libraries which build against the current API will break.

Another problem is that relying on an undocumented behavior in an API specification may cause confusion for some programmers. Ordered keys in hashtables are an unusual behavior, and a reader of dynamo.js schemas who isn't familiar with these semantics may not get what is happening.

(What file is this code in, btw? Maybe I'll take a crack at it.)

from dynamo.

jed avatar jed commented on May 27, 2024

wow, some opinionated people in that thread.

i'd like to add support for more explicit key order, but there are several options:

  • accepting an array
  • accepting a hash with hash and range keys that have Object values
  • requiring a schema to be specified when a table is created

i think the first is the most straightforward.

there are two places that would need attention: Key.js and KeySchema.js. i'm in favor or allowing arrays using isArray to check. would you like to take a crack at it?

from dynamo.

 avatar commented on May 27, 2024

Excellent. I will try to take a look, but can't promise anything quickly. (Or if someone can get to it before me, please do)

from dynamo.

mlogan avatar mlogan commented on May 27, 2024

Hi everyone,

I took a crack at this: See #35

Comments welcome.

Thanks,
Mark

from dynamo.

jed avatar jed commented on May 27, 2024

fixed by @mlogan in #35.

from dynamo.

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.