question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autoreload is disabled because the development mode is off

See original GitHub issue

Describe the bug With v0.6.0 and above, running the docker run command gives the following issue -

Screenshot 2021-04-01 at 8 36 27 PM

To Reproduce

  1. Run the following command -
docker run --rm -it --name my-data-api -p 8080:80 -e MYSQL_HOST=host.docker.internal -e MYSQL_PORT=3306 -e MYSQL_USER=root -e RESOURCE_ARN=arn:aws:rds:ap-south-1:123456789012:cluster:dummy -e SECRET_ARN=arn:aws:secretsmanager:ap-south-1:123456789012:secret:dummy -e MYSQL_PASSWORD=password koxudaxi/local-data-api:0.6.0

Expected behavior (Successful with v0.5.8)

Screenshot 2021-04-01 at 8 37 52 PM

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chaiiplsscommented, Apr 7, 2021

Thanks, I’ll try this out and let you know!

0reactions
koxudaxicommented, Apr 6, 2021

@chaiiplss I just tested your SQL with data-api-client. It works on local-data-api and real AWS DataAPI. Also, I use this docker-compose.yml I recommend using the latest version (0.6.7) which is fixed few bugs.

I show you the test script and the result.

sample.ts

import Client = require('data-api-client');

const data='DROP TABLE IF EXISTS person;\n' +
    'CREATE TABLE person (id int, first_name varchar(20), age int, gender char(1));\n' +
    'INSERT INTO person VALUES (1, \'Bob\', 25, \'M\');\n' +
    'INSERT INTO person VALUES (2, \'Jane\', 20, \'F\');\n' +
    'INSERT INTO person VALUES (3, \'Jack\', 30, \'M\');\n' +
    'INSERT INTO person VALUES (4, \'Bill\', 32, \'M\');\n' +
    'INSERT INTO person VALUES (5, \'Nick\', 22, \'M\');\n' +
    'INSERT INTO person VALUES (6, \'Kathy\', 18, \'F\');\n' +
    'INSERT INTO person VALUES (7, \'Steve\', 36, \'M\');\n' +
    'INSERT INTO person VALUES (8, \'Anne\', 25, \'F\');'
// @ts-ignore
async function f() {
    let connection = Client({
        secretArn: 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy',
        resourceArn: 'arn:aws:rds:us-east-1:123456789012:cluster:dummy',
        database: 'test',
        region: 'us-east-1',
        sslEnabled: false,
        keepAlive: false,
        options: {
            endpoint: 'localhost:8080'
        }
    })
    for (const sql of data.split('\n')) {
        const res = await connection.query(sql)
        console.log(sql,'\n', res)
    }

    const res = await connection.query('' +
        'SELECT    first_name,\n' +
        '          age,\n' +
        '          gender,\n' +
        '          @curRank := IF(@curAge IS NULL, @curRank + 1 , 1) AS rank\n' +
        'FROM      person p, (SELECT @curRank := 0, @curAge := null) r\n' +
        'ORDER BY  age;')
    console.log('select...','\n', res)


}
f().then()

Result

$ ts-node sample.ts
DROP TABLE IF EXISTS person; 
 { numberOfRecordsUpdated: 0 }
CREATE TABLE person (id int, first_name varchar(20), age int, gender char(1)); 
 { numberOfRecordsUpdated: 0 }
INSERT INTO person VALUES (1, 'Bob', 25, 'M'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (2, 'Jane', 20, 'F'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (3, 'Jack', 30, 'M'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (4, 'Bill', 32, 'M'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (5, 'Nick', 22, 'M'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (6, 'Kathy', 18, 'F'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (7, 'Steve', 36, 'M'); 
 { numberOfRecordsUpdated: 1 }
INSERT INTO person VALUES (8, 'Anne', 25, 'F'); 
 { numberOfRecordsUpdated: 1 }
select... 
 {
  records: [
    { first_name: 'Kathy', age: 18, gender: 'F', rank: 1 },
    { first_name: 'Jane', age: 20, gender: 'F', rank: 2 },
    { first_name: 'Nick', age: 22, gender: 'M', rank: 3 },
    { first_name: 'Bob', age: 25, gender: 'M', rank: 4 },
    { first_name: 'Anne', age: 25, gender: 'F', rank: 5 },
    { first_name: 'Jack', age: 30, gender: 'M', rank: 6 },
    { first_name: 'Bill', age: 32, gender: 'M', rank: 7 },
    { first_name: 'Steve', age: 36, gender: 'M', rank: 8 }
  ]
}


Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto-reload | Ktor
To use Auto-reload, you need to enable the development mode first. This depends on the way you used to create and run a...
Read more >
How to enable development mode in embedded server to use ...
I'm using Ktor for my back end, I am planning to use auto reload and when I used engine ...
Read more >
Code autoreload not working for me · Issue #975 · ktorio/ktor
The issue is, when I change Application.kt the project doesn't reload and the changes are not reflected in the browser. I see this...
Read more >
Development mode enabled in 'application.conf' with the ...
Run the server. The Run tool window shows the following message: INFO Application - Autoreload is disabled because the development mode is off....
Read more >
Kotlin with Ktor 02 - Setting up auto-reloading for a ... - YouTube
Please note that auto-reloading should NOT be run in production mode as it is intended for development ONLY! NOTE: Requires to terminal tabs ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found