Git Product home page Git Product logo

adonis-dynamodb's Introduction

Hi 👋, I'm Oussama

A passionate fullstack web developer since my childhood.

melchyore

melchyore

melchyore

Connect with me

melchyore

Programming Languages

                                                

Frontend Development

                                          

Backend Development

            

Mobile App Development

                              

Database

                                    

DevOps

            

Support

melchyore



melchyore

 melchyore

melchyore

adonis-dynamodb's People

Contributors

melchyore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adonis-dynamodb's Issues

E_IOC_LOOKUP_FAILED: Cannot resolve "Adonis/Addons/DynamoDB" namespace from the IoC Container

Prerequisites

  • Adonis 5
  • adonis-dynamodb

Description

Encountering error when importing the library itself. Here is how we import the library:

import type {Query} from '@ioc:Adonis/Addons/DynamoDB'
import Env from '@ioc:Adonis/Core/Env'
import {DynamoDB} from '@ioc:Adonis/Addons/DynamoDB'

This error shows up when using yarn dev or running the dev server using npm.

However when deploying the app on Docker the issue doesn't shows up. I must have been running this on detached that is why I don't see the Docker error.

Package version

"adonis-dynamodb": "^1.2.3"

Error Message & Stack Trace

[ info ]  re-starting http server...

  IocLookupException 

 E_IOC_LOOKUP_FAILED: Cannot resolve "Adonis/Addons/DynamoDB" namespace from the IoC Container

 at Function.lookupFailed <path>/node_modules/@adonisjs/fold/build/src/Exceptions/IocLookupException.js:18
  13|  /**
  14|   * Raised when unable to lookup a namespace
  15|   */
  16|  class IocLookupException extends utils_1.Exception {
  17|      static lookupFailed(namespace) {
> 18|          return new this(`Cannot resolve "${namespace}" namespace from the IoC Container`, 500, 'E_IOC_LOOKUP_FAILED');
  19|      }
  20|      /**
  21|       * Invalid namespace type
  22|       */
  23|      static invalidNamespace() {

   1  Ioc.lookupOrFail
     <path>/node_modules/@adonisjs/fold/build/src/Ioc/index.js:254

   2  Ioc.use
     <path>/node_modules/@adonisjs/fold/build/src/Ioc/index.js:308

   3  Object.<anonymous>
     <path>/app/DynamoDb/DynamoDb.ts:3

   4  Module._compile
     <path>/node_modules/pirates/lib/index.js:136

   5  Object.newLoader [as .ts]
     <path>/node_modules/pirates/lib/index.js:141

[ warn ]  Underlying HTTP server died with "0 code"

Relevant Information

migrate aws-sdk v3

Do you have plan to migrate to AWS SDK v3?

Error Message & Stack Trace

NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).

Relevant Information

DynamoDB query output returns all properties and values but toJSON doesn't

Prerequisites

  • Adonis 5
  • adonis-dynamodb

Description

Has anybody else experienced where in the DynamoDB model doesn't return all properties indicated? I tried console logging the DynamoDB query output and it shows the properties that are missings but when converting the output to JSON it's missing properties. Here is an example:

...
@DynamoDB.$Table({name: Env.get('TABLE', '')})
export default class DynamoDb extends DynamoDB.Table {
  ...

    @DynamoDB.Attribute.String()
    public name: string

    @DynamoDB.Attribute.String()
    public description: string

    @DynamoDB.Attribute.String()
    public sample: string

    @DynamoDB.Attribute.Any()
    public type: string | number

    @DynamoDB.Attribute.Any()
    public order: string | number

    @DynamoDB.Attribute.Any()
    public sample: string

    @DynamoDB.Attribute.Any() // Even tried StringSet but doesn't work
    public values: Array<string>
  ....
}
// console.log(dynamoOutput)
...
name: {S: 'Test'},
description: {S: 'Test description'},
sample: {S: 'Test example'}, // <-- this is missing when toJSON is called
type: {N: 1}, // <-- this is missing when toJSON is called
...
// console.log(dynamoOutput.toJSON())
{
    name: 'Test',
    description: 'Test description'
}

Package version

"adonis-dynamodb": "^1.2.3"

Error Message & Stack Trace

  • No errors just missing properties and values when using toJSON()

Relevant Information

  • Data properties and values are present in the database
  • Tried to stringify the dynamo query output still missing the other details

Support for newer version of Dyngoose

Description

There is a new version of Dyngoose where it supports Attribute.Dynamic which would be very helpful as it supports mixed or multiple attribute/value on a single property. It would be great if the version dependency of this library be updated to that version. Attributes#Dynamic.

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.