63 questions
0
votes
0
answers
67
views
Static MySQL XDevApi library failed to build in VSCode CMake Project
So I'm currently trying to make xdevapi work with cpp-httplib. This is my current CMakeLists.txt
cmake_minimum_required(VERSION 3.5.0)
project(http-server VERSION 0.1.0 LANGUAGES C CXX)
...
0
votes
0
answers
31
views
C++: MySQL xdevapi crashes when inserting data (throws no meta-data found error)
I'm trying to insert some data in a MySQL table using the C++ Xdevapi. The following code for inserting something in a table unsurprisingly works:
t.insert().values(0, "cng", "CNG")...
0
votes
0
answers
38
views
Facing an issue to convert timestamp to date in MySqlX.XDevAPI
I am trying to convert TimeStamp to Date format for easier comparisons to fetch records from my
MySqlX db but when I try to query it like this
DbDoc docData = new DbDoc(new { _startDate = startDate....
0
votes
0
answers
17
views
C++ MySQL X DevAPI Connection Error: Undefined Reference [duplicate]
I'm trying to establish a basic MySQL C++ connection using MySQL X DevAPI. However, when compiling my code, I'm getting the following error:
undefined reference to `mysqlx::abi2::r0::common::...
1
vote
1
answer
142
views
How to get rows as array of JSON object instead of array of array in MySQL X DevAPI select query?
I am using MySQL X DevAPI for relational tables in MySQL.
// Working with Relational Tables
var mysqlx = require('@mysql/xdevapi');
var myTable;
// Connect to server using a connection URL
mysqlx
....
2
votes
1
answer
170
views
How to get raw SQL query from MySQL X DevAPI SQL CRUD functions?
I am using MySQL X DevAPI. That is working fine for relational tables.
// Working with Relational Tables
var mysqlx = require('@mysql/xdevapi');
var myTable;
// Connect to server using a connection ...
0
votes
1
answer
212
views
Node.js, Express.js and @mysql/xdevapi based Boilerplate code?
I am using @mysql/xdevapi in my Express.js application for creating REST web APIs.
My current way of using @mysql/xdevapi is
const mysqlx = require('@mysql/xdevapi')
const options = {
host: '...
1
vote
1
answer
99
views
DATE_ADD() is not working in MySQL XDev API with Node.js
In MySQL shell I am able to run
select * from meeting where startTime > date_add(now(), interval 2 day);
This same command is not working using MySQL XDev API
var meetingRows = (await sqldb....
0
votes
1
answer
85
views
Reconnect logic on connection close in X DevAPI of MySql using @mysql/xdevapi module in Node.js
I am using X DevAPI of MySql v8.0.33 using @mysql/xdevapi v8.0.33.
I have reconnect logic added but that is not working. Here is that code.
const mysqlx = require('@mysql/xdevapi')
async function ...
-2
votes
1
answer
1k
views
How do I solve this error: "SQL error: too many arguments"
I have an API through Firebase Functions. When sending an request to the API with the body {"name":"1234"} with postman. I get the error 401 "SQL : Error: Too many arguments&...
0
votes
1
answer
76
views
Initialize cobject with move assignment/constructor c++ in another class constructor [duplicate]
I'm using the mysqlx-api/xdevapi.h (mysql connector 8) for my application. My code is object oriented, and I want to initialize the connection to the database in the class constructor. It that ...
0
votes
1
answer
69
views
connector/node.js collection.add().execute() seems to only work once
I am testing MySQL Document Store. In order to properly compare with our relational tables, I am attempting to transform our current table into a collection. There approximately 320K records in the ...
0
votes
2
answers
201
views
X devAPI batch insert extremely slow
I use the C++ connector for MySQL and the X dev API code.
On my test server (my machine), doing a single insert in loop is pretty slow (about 1000 per second) on a basic table with a few columns. It ...
0
votes
1
answer
114
views
Manual Insert into MySQLx Collection
I have a large amount of JSON data that needs to be inserted into a MySQLx Collection table. The current Node implementation keeps crashing when I attempt to load my JSON data in, and I suspect it's ...
0
votes
1
answer
138
views
How can I query for multiple values after a wildcard?
I have a json object like so:
{
_id: "12345",
identifier: [
{
value: "1",
system: "system1",
text: "text!"
},
...
0
votes
2
answers
83
views
How to use results from mysql built-in functions when inserting via mysql-x-devapi in C++?
I am using mysql-x-devapi and need to insert a row to a table and put UNIX_TIMESTAMP() of the server in a column:
sql_client_.getSession().getDefaultSchema()
.getTable("event")
....
0
votes
1
answer
900
views
Typescript : store an arrayBuffer into MySQL database using blob and xdevapi
I want to store user files (images most of the time, but it can be anything) retrieved with a HTML input, into MySQL database.
So I want to store the arrayBuffer of a file in a MySQL blob, using @...
0
votes
1
answer
605
views
MySQL XDev API - Node.js Connector - client.getSession() never resolve nor throw after few hours
I use the MySQL XDevAPI connector in nodejs to connect to a MySQL db on the same server. It runs successfully few hours until, at some point await pool.getSession() never resolve nor throw any error.
...
0
votes
1
answer
68
views
MySql: xDevApi "collection.modify" not doing anything
I'm testing MySql 8 "XDevApi" with Nodejs, and I'm trying to modify a field in a document
Here is the code :
let vModifyOp=await vCollection.modify('_id = "000062817c620000000000000001"')...
1
vote
1
answer
542
views
How to check mysql session/connection status with driver 8.0.XX C++ API
In my C++ code, I am using MySQL driver 8.0.xx and using xdevapi because of the costly approach of establishing a connection to the database for each client request, I am using a pool of database ...
0
votes
0
answers
76
views
Values in MySQL 8 document store are being escaped when stored, but not unescaped when retrieved
I have PHP 8 and MySQL 8 running using the xdevapi. Everything is working well with it, but I am running into an issue storing data in a document in a collection.
I have the following methods in a ...
0
votes
5
answers
731
views
How is date encoded/stored in MySQL?
I have to parse date from raw bytes I get from the database for my application on C++. I've found out that date in MySQL is 4 bytes and the last two are month and day respectively. But the first two ...
1
vote
1
answer
604
views
How to get value by field name in MYSQL xdevapi 8.0 connector c++
For connector c++ 1.1, in this example, it's quite easy to get values by specifying the column name (or alias name).
But when I upgraded to version 8.0 xdevapi, I found this feature is no longer ...
0
votes
0
answers
211
views
Would like to prevent possible code Injection on legacy PHP web app
So our ancient web app manages to pass an annual code review with minimal red flags. One of those possible security risks was this function below that gets a user's session info.
private function ...
1
vote
1
answer
383
views
Using Mysql xdevapi
I am trying to work with Mysql as a document store using xdevapi, but it is written in JavaScript and I am using TypeScript,so I found mysqlx a type definition for xdevapi and I don't know if it is a ...
0
votes
2
answers
238
views
MYSQL XDev API Javascript Select all from a table
I'm trying to get all the promocodes out of a table but I'm not sure what we should use for the bind parameter. I tried '*', ' ', '%%', and '%' but the results came out undefined/no results. Anyone ...
0
votes
1
answer
87
views
MYSQL XDEVAPI Multiple OR (II) Request
I'm using the XDEVAPI and trying to use the or(||) statement in javascript, but it seems to break after 1 or/(||) statements, I have 5 separate statuses I'm trying to pull from the DB:
.select(['...
1
vote
0
answers
336
views
mysqlx xdevapi cmake undefined reference compilation error
I am trying to import mysql connector to my c++ project but I am getting errors at the linking stage. This is my
CMakeLists.txt:
add_executable(app
src/main.cpp
)
add_library(mysql STATIC ...
0
votes
1
answer
152
views
@mysql/xdevapi How to debug "wrong number of fields in row being inserted" in nodejs?
I successfully connected to a local MySQL server using the new x-authentication. I have a products table with the following schema (DDL):
CREATE TABLE `products` (
`id` int unsigned NOT NULL ...
1
vote
0
answers
299
views
xdevapi for MySQL using c++ connector linker issues [duplicate]
I am new and was trying to learn xdevapi for MySQL. i wanted to use it with C++ code on my windows device. but i am having a hard time running sample code. and i am getting a lot of linker errors. ...
0
votes
1
answer
289
views
MySQL xdevapi Node Error: SELF_SIGNED_CERT_IN_CHAIN
Windows 10 Pro
MySQL8.0
node.js v14.15.5
openssl 1.1.1c
I'm trying to connect to a MySQL database using node, I'm able to connect without TLS just fine. I used openssl to create a private key and ...
0
votes
1
answer
171
views
MYSQL X DEV API Update method not working
I could not find a good template for the update method for the xdevapi library and thought maybe some one could help me out with getting this to work.
acts_table
.update()
.set('account_status'...
0
votes
1
answer
139
views
How to query for Null or Missing Fields in Mysql X DevAPI?
How to query for null or missing field in Mysql X DevAPI?
I tried .find("age IS NULL") and .find("age = null") but both not work.
> db.createCollection('users')
> db....
0
votes
0
answers
286
views
Where do I find the Connector/C++ debug package (X DevAPI)?
I was able to build a MyySQL\C++ project in release mode, but I'd like to build it in debug mode as well. The documentation says that I'll need to install the Connector/C++ debug package in order to ...
0
votes
1
answer
622
views
Running arbitrary SQL commands MySQL C++ (X DevAPI)?
I've connected my C++ project to MySQL and successfully created a session. I was able to create a Schema. My issue is that when I try to run simple arbitrary queries like USE testSchema SHOW tables; ...
0
votes
1
answer
120
views
Searching nested arrays with X DevAPI
I want to use a MySQL database to manage a collection of documents in JSON format. Let's say each document has this structure:
{
"firstname":"John",
"lastname":"...
0
votes
1
answer
2k
views
How do you use the MySQL Connector/C++ and XDevAPI while using XAMPP to run MySQL?
I am trying to access a MySQL database in my C++ code. I have a feeling I may have messed something up along the way, so I'll outline what steps I took and my setup:
I installed MySQL Connector/C++
I ...
1
vote
1
answer
949
views
mysqlx plugin unreachable on Amazon RDS (MySQL 8.0)
Running local instances okay but have problem connecting to MySQL RDS AWS, not a connectivity issue to RDS private network.
This is the error when attempting to make a connection. ERROR - Unable
to ...
0
votes
1
answer
1k
views
X DevAPI mysqlx::Session() over linux socket fails with “CDK Error: unexpected message”
I’ve (3) freshly installed mysql, (4) freshly installed Connector/C++ 8.0 X DevAPI, (5) did minimal configuration in my.cnf, (1) wrote a minimal C++ program, (2) build it, and after executing it gave ...
0
votes
1
answer
230
views
Using the MSQL XDEVAPI In Node JS, can I chain multiple calls together?
Example, I'm trying to check to see if a value exists in a table and then if no duplicates exists write the values in the same table, but its not working. Let me know if chaining the calls is possible ...
0
votes
1
answer
97
views
PHP mysql_xdevapi extension: replaceOne() seems not to be idempotent
If I replace a document with itself in a collection, the document seems to be altered. My data becomes unusable because of this problem. What am I doing wrong?
<?php
$login = '***removed***';
$...
1
vote
1
answer
233
views
info about MySQL Shell
I'm using the MySQL shell for the first time.
I ran the following commands:
\connect --mysql root@localhost:3306
\use myschema
But, when I try to follow this instruction:
myColl = db....
1
vote
1
answer
398
views
C++ XDevAPI multiple .values
I am using Xcode, MySQL and XDevAPI.
I have the following table on the database
create table TABLE(ID INT, VALUE_01 INT, VALUE_02 INT, VALUE_03 INT);
I have the following values on code the code:
...
0
votes
1
answer
368
views
@mysql/xdevapi ECONNREFUSED doesn't release connection
I'm using the @mysql/xdevapi npm package (version 8.0.22) with a local installation of mysql-8.0.15-winx64.
I have set pooling to enabled and attempted to retrieve a session from the client. If I do ...
0
votes
1
answer
262
views
@mysql/xdevapi won't allow array parameters for WHERE field IN (?) query
I'm using the @mysql/xdevapi npm package with a local installation of mysql-8.0.15-winx64.
I'm trying to execute a SQL string with parameters. The query is looking for records where the id is IN an ...
0
votes
1
answer
277
views
can't install mysql_xdevapi on ami linux2
I need mysql_xdevapi extension. trying through sudo pecl install mysql_xdevapi
error: C++ preprocessor "/lib/cpp" fails sanity check - fixed.
error: boost not found - fixed.
error: protobuf ...
1
vote
1
answer
146
views
Filter using date field in mysql Document store(Nosql) in C#
How can i filter a date field in document store table (NoSQL) in c#.
i need to filter created ate greater than particular time.
the date is storing as string values in nosql.
I had only found the ...
0
votes
0
answers
71
views
How to ping with MySQL X Dev API
In old MySQL API you can use mysql_ping() to archive that. But is there any similar function in X Dev API?
2
votes
1
answer
445
views
Cannot install php extension 'mysql_xdevapi' on mac
When I run pecl install mysql_xdevapi in the terminal I get the following error:
configure: error: protobuf not found, please install it in system, consider use of --with-protobuf or setting ...
0
votes
1
answer
82
views
XDevApi How to Send Back the Result of .insert()
.insert() is successful, but the following resulting {result:{}} in Postman. How do I send the whole object in screen back so the client can query properties?