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

No output on Windows when using mysql lib #14464

Open
fatihkizmaz opened this issue May 19, 2022 · 1 comment
Open

No output on Windows when using mysql lib #14464

fatihkizmaz opened this issue May 19, 2022 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@fatihkizmaz
Copy link

V version: V 0.2.4 c01a8a1.3291c59
OS: Windows 10 Pro v19044 64 bit

What did you do?
I am trying to test mysql connection on windows platform. I followed all the instructions (installed mysql, copied include and lib directories to directory thirdparty/mysql), but could not execute a basic test successfully. The fact is, it does not give any error, also it outputs nothing!

The sample code i used to test:

import mysql

fn main() {
	println('connecting..')
	mut conn := mysql.Connection{
		host: 'localhost'
		port: 3306
		username: 'root'
		password: ''
		dbname: 'mysql'
	}
	conn.connect() ?
	println('querying..')
	res := conn.query('show tables') ?
	for row in res.rows() {
		println(row.vals.join(', '))
	}
	println('disconnecting..')
	conn.close()
}

An image that shows terminal after running sample file. No output!
image

@fatihkizmaz fatihkizmaz added the Bug This tag is applied to issues which reports bugs. label May 19, 2022
@Ouri028
Copy link

Ouri028 commented May 19, 2022

Getting the same issue on my end.

pub fn initialize_database() {
	if utils.get_env("FRESH_INITIALZE") == "true" {
		mut db := database.db_conn() or {panic("UNABLE TO CONNECT TO DATABASE WITH ERROR: $err")}
		sql db {
			create table entity.Users
			create table entity.Accounts
			create table entity.Roles
			create table entity.Active_Agents
			create table entity.Agent_Statuses
			create table entity.Stream_Interactions
		}
		logger.info("Fresh initialization has been completed.")
		db.close()
	} else {
		logger.info("Fresh initialization has been disabled.")
	}
}

C:\Users\Sylvester\Documents\Github\v-lang\vidi_widget_core>v run vidi_widget_core.v

C:\Users\Sylvester\Documents\Github\v-lang\vidi_widget_core>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants