wix-incubator / corvid-external-db-mysql-adapter Goto Github PK
View Code? Open in Web Editor NEWCorvid by Wix Example: External Database Collection Adapter
License: MIT License
Corvid by Wix Example: External Database Collection Adapter
License: MIT License
Hi,, I already successfully creating connecting and made some testing with external database mysql with wix , but there was error when creating/adding dynamic page with external database. how to resolve this.
and in the documentation wix external database
To use Dynamic Pages with external collections at least one of the fields needs to accept the urlized filter. That field will be used for generating dynamic page links.
here my table structure in mysql
table name : testtb
+---+--------+-------+---------------+---------------+-------------------+----------------+
| _id | _owner | name | _createdDate | _updatedDate | link-testtb-name | link-testtb-all |
+---+--------+-------+---------------+----------------+------------------+----------------+
I want to create dynamic page base on field "name"
so I created fields link-testtb-name and link-testtb-all (varchar(225) ) but it does not work.
can give me an example the field format/type or how to use it ?
Hey, how to load image URLs from an external database in the gallery?
So I've created a SQL server, and created a database named test 1. I left all else alone. I've connected it to the google cloud using the image given, and the following variables (generalized of course) for the google cloud run service.
SECRET_KEY "secret"
ALLOWED_OPERATIONS ["get", "find", "count"]
SQL_CONFIG {"socketPath":"socketpath","user": "[root]","password":"[password]","database":"test1"}
In my database I made a table named wow, gave it an _id column, which is a varchar type. I added a row which just has a 2 in it
When I go to connect on the wix site, I put the service url, give it the name SQL, and put in
{"secretKey":"secret"}
I made no personal changes to the adapter (which I think is what the image on the google cloud run is)
Now what I think should happen is there should be a folder named sql, which has a table named wow, and I should click on it and it will display the column _id, with a 2 under it. Am I wrong in assuming it should work like this? If not, what have I done wrong? I've tried to be as thorough as possible in my explanation.
it would be really helpful to host this on docker hub and show a simple way to run it using docker and not necessarily with gcloud (why should the documentation for this be strictly for gcloud?)
Hi,
first of all thank you for creating this boilerplate! I have set up the application following your documentation on Google Cloud Run.
Despite me having configured all allowed permissions ["get", "find", "count", "update", "insert", "remove"], Wix is now allowing me to create a new item and shows me the collection being "read-only". Updating items I created via a direct connection to the MySQL database works properly. What am I doing wrong here?
On another note I realized that the sandbox and live data displayed in Wix are identical. Is it correct that there is no difference between sandbox and live when using external databases?
Many thanks for your support.
When trying to set up external database collection on wix the adapter throws this TypeError
.
I have double-checked my config.json having the correct data and credentials. I also gave the mysql user all permissions, but it didn't change anything.
(node:15484) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
at /home/mysql-adapter/corvid-external-db-mysql-adapter/client/database.js:40:27
at Query.<anonymous> (/home/mysql-adapter/corvid-external-db-mysql-adapter/client/database.js:72:15)
at Query.<anonymous> (/home/mysql-adapter/corvid-external-db-mysql-adapter/node_modules/mysql/lib/Connection.js:525:10)
at Query._callback (/home/mysql-adapter/corvid-external-db-mysql-adapter/node_modules/mysql/lib/Connection.js:491:16)
at Query.Sequence.end (/home/mysql-adapter/corvid-external-db-mysql-adapter/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at /home/mysql-adapter/corvid-external-db-mysql-adapter/node_modules/mysql/lib/protocol/Protocol.js:404:18
at Array.forEach (<anonymous>)
at /home/mysql-adapter/corvid-external-db-mysql-adapter/node_modules/mysql/lib/protocol/Protocol.js:403:13
at processTicksAndRejections (internal/process/task_queues.js:76:11)
(node:15484) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15484) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code
I have followed the instructions, including the SQL_CONFIG setup, but when I try to connect to the external database from wix I get the following error ...
"Unable to fetch result (Connector with namespace 'wixtest' and instanceId 'b6fa1942-76ef-4b08-b19d-9adc66ad4341' fails provision request)"
The only message that is left by the API Call is:
{ "message": "Cannot enqueue Query after fatal error." }
Auth to database is made and connection is working…
Provision-Request seems also ok. I use Postman and send the following configuration as POST body:
{
"requestContext" : {
"settings" : {
"secretKey":""
}
}
}
Hi,
I was able to link my SQL database to a wix collection. My issue now is that even though I have a permissions secret giving read permissions to everyone, the wix collection still shows it for admin only...can someone please point me in to the right direction? Tks!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.