Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 'string' for uidType #83

Open
derekwsgray opened this issue Sep 21, 2018 · 2 comments
Open

Support 'string' for uidType #83

derekwsgray opened this issue Sep 21, 2018 · 2 comments

Comments

@derekwsgray
Copy link

I looked through the source of store-sequelize and the sqlHandler had the code I was looking for to support a uidType of string:

switch (relation._settings._uidType) {
    case 'uuid':
      modelProperties.id = {
        type: DataTypes.UUID,
        allowNull: false
      }
      break
    case 'autoincrement':
      modelProperties.id = {
        type: DataTypes.INTEGER,
        allowNull: false,
        get: function () {
          return this.getDataValue('id').toString()
        }
      }
      break
    case 'string': default:
      modelProperties.id = {
        type: DataTypes.STRING,
        allowNull: false
      }
      break
  }

But to my dismay, the joi.one isn't allowing 'string' to pass through and insisting the type must be UUID or auto-increment.

RDF Data is uniquely identified by IRI's, so I need longer than the 38 characters allowed by default.

Thanks!

@championswimmer
Copy link
Member

okay we gotta fix it here

https://github.com/jagql/framework/blob/master/lib/ourJoi.js#L29

will do in a day or two

@derekwsgray
Copy link
Author

@championswimmer are you still active on this project? Haven't seen an update in a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants