Skip to content

any operation return same weird object #58

@taisen

Description

@taisen

Hello,

I tried to use the expo-sqlite-orm but any operation (createTable, find, findBy..) returned

{"_h": 0, "_i": 0, "_j": null, "_k": null}

can you please help?

The code

  const param = new Parameter(props);
  param.save();

  let paramInDb = Parameter.findBy({ id_eq: 1 });
  console.log("paramInDb 1");
  console.log(paramInDb);
  console.log("paramInDb 2");
  console.log(Parameter.find(1));
  console.log(Parameter.query());

The Parameter class

import * as SQLite from "expo-sqlite"
import { BaseModel, types } from 'expo-sqlite-orm'


export default class Parameter extends BaseModel {
constructor(obj) {
  super(obj)
}

static get database() {
  return async () => SQLite.openDatabase('videothequesss.db')
}

static get tableName() {
  return 'parameters'
}

static get columnMapping() {
  return {
    id: { type: types.INTEGER, primary_key: true },
    nameParam:{ type: types.TEXT },
    valueParam: { type: types.TEXT }
  }
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions