denodb icon indicating copy to clipboard operation
denodb copied to clipboard

Denodb mysql just return empty array

Open fzn0x opened this issue 3 years ago • 6 comments

Hi , Something's bothering me, mysql doesn't return any data , just empty array. But in my localhost the data was exist

Version

deno 1.3.0
v8 8.6.334
typescript 3.9.7

Source Code :

import {DataTypes, Database, Model} from 'https://deno.land/x/[email protected]/mod.ts';

const db: Database = new Database('mysql', {
    host: "localhost",
    username: 'root',
    password: "",
    database: 'denovel',
    port: 3306
});

class User extends Model {
    static table = "users";
    static timestamps = true;

    static fields = {
        id: {
            primaryKey: true,
            autoIncrement: true
        },
        username: DataTypes.STRING,
        password: DataTypes.STRING
    };

    eachFieldNameWithAnExclamationMark !: string;
    username !: string;
    password !: string;
} db.link([User]);

const data = await User.select("username").all();

console.log(data);

Result

INFO connecting localhost:3306
INFO connected to localhost
[]

fzn0x avatar Sep 02 '20 06:09 fzn0x

I added this source code because there was problem with save method in denodb before.

    eachFieldNameWithAnExclamationMark !: string;
    username !: string;
    password !: string;

fzn0x avatar Sep 02 '20 06:09 fzn0x

This can relate https://github.com/manyuanrong/deno_mysql/issues/29

fzn0x avatar Sep 02 '20 07:09 fzn0x

I tried your source code, and it still works for me

image

deno 1.3.0 v8 8.6.334 typescript 3.9.7

Versi server: 10.4.8-MariaDB - mariadb.org binary

Rakhmadi avatar Sep 02 '20 14:09 Rakhmadi

I tried your source code, and it still works for me

image

deno 1.3.0 v8 8.6.334 typescript 3.9.7

Versi server: 10.4.8-MariaDB - mariadb.org binary

yeah i think i have problem with my MariaDB , like link i refer here https://github.com/eveningkid/denodb/issues/107#issuecomment-685389068

fzn0x avatar Sep 04 '20 01:09 fzn0x

Hey,

Has this issue been solved on their end?

Are you still facing it in denodb?

Keep in touch

eveningkid avatar Sep 05 '20 22:09 eveningkid

Hey,

Has this issue been solved on their end?

Are you still facing it in denodb?

Keep in touch

This hasn't been solved, maybe issue with my Maria DB

fzn0x avatar Sep 07 '20 04:09 fzn0x