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

'String' in Data Type Declaration does not work #1085

Closed
webgoto opened this issue May 4, 2023 · 4 comments
Closed

'String' in Data Type Declaration does not work #1085

webgoto opened this issue May 4, 2023 · 4 comments
Labels

Comments

@webgoto
Copy link

webgoto commented May 4, 2023

Thanks for the great library.

Information

  • Version of Medoo: 2.1.8
  • Version of PHP: 8.1
  • Type of Database (MySQL, MSSQL, SQLite...): SQLite
  • System (Liunx|Windows|Mac): Windows

Describe the Problem
A clear and concise description of what the problem is.

$db->select('folder', ['id[String]','name','articleOrder[JSON]']);
Even if you run this, the ID will be returned as a number.

Looking at the source code
https://github.com/catfan/Medoo/blob/master/src/Medoo.php#L1464

                        case 'String':
                            $stack[$columnKey] = $item;
                            break;

Shouldn't we add (string) like this?
$stack[$columnKey] = (string) $item;

@catfan catfan added the bug label May 4, 2023
@catfan
Copy link
Owner

catfan commented May 8, 2023

Thanks for the feedback.

Would you submit a pull request for this?

@webgoto
Copy link
Author

webgoto commented May 8, 2023

Sorry. Due to my lack of skill, I don't know how to use git.

@catfan
Copy link
Owner

catfan commented May 8, 2023

@webgoto OK, I will fix it.

@carliblaz
Copy link

I'm not sure that this was OK, db field bigint(20) has now string value not int.

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

No branches or pull requests

3 participants