Time for new possibilities of Wix-Data

When it will be possible to generate/create a new collection/database by code, defining also all it’s DB-Field-Types by code aswell?

@_wix-2
If you need some code for it…

import wixData from 'wix-data';

const collectionSchema = {
  "title": "My Collection",
  "description": "This is my collection schema",
  "fields": [
    { "name": "name", "type": "text" },
    { "name": "age", "type": "number" },
    { "name": "email", "type": "email" },
    { "name": "dateOfBirth", "type": "date" },
    { "name": "isSubscribed", "type": "boolean" },
    { "name": "avatar", "type": "image" },
    { "name": "description", "type": "text" },
    // Add more fields here
  ]
};

  wixData.createCollection("myCollection", collectionSchema)
  .then((collection) => {
    // Collection has been created with the defined schema
    console.log(`Collection ${collection.title} created successfully`);
  })
  .catch((error) => {
    console.error(`Failed to create collection: ${error}`);
  });

It is time to implement this function/method to the Wix-Data-API to expand the features and functions of Wix-Data.

I hope this won’t take any longer, since the CODE is already here :grin:

Make it possible for us, to create databses the dynamic way (by code), instead to generate them all the time manually inside the Content-Manager.

A -------> FAST-SOLUTION <------- IS VERY APPRECIATED !

Thanks for hearing my voice.

2 Likes

Check this out: https://dev.wix.com/api/rest/wix-data/wix-data/data-collections/create-data-collection

Thanks old friend! I will take a look into this, even if i do not know much about CURL-Programming.

I forgot totally about Wix-Developers. I should take a deeper look onto it.
Time to open a new door :grin::roll_eyes:

Thanks for the link.

Tips: ask an AI to translate CURL into javascript fetch call :wink:

1 Like

I agree it would make sense to fully include WixData feature https://dev.wix.com/api/rest/wix-data/wix-data into Wix.

I would love to be able retrieve database schema, or to generate/edit collection via code.

Yes, this i already know, but this still not explain me —> when and why i do need CURL :grin:
But i am honest, till now i was lazy to read stuff about CURL.
BIG LECK OF KNOWLEDGE in this area.

It’s like start again from ZERO.

But thanks for the tip !!! I will also try this out.
I will need some time for it to investigate all functions, features and how all that works → (like with VELO and JS and HTML and CSS and VBA).

The list gets bigger and bigger —> Seems like a never-ending-story. :laughing:

I am waiting for it now surely for 2-3 years :grin:.
And if CC would give me that tip earlier (hopely it will work), i would have studied CURL already.

Seems like we will get new API soon…

I :heart: it !!!


Great news for me / us!