Back

[Solved] Bulk create project on AppWrite

  • 0
  • Databases
  • Tools
LDs_Group
1 Sep, 2023, 20:37

Sorry πŸ˜” comparison is not my goal

TL;DR
Solution: The user was able to find a solution themselves after some testing. They shared a code snippet in JSON format for creating a project on AppWrite. Additionally, they mentioned that Appwrite v1.4 now has export/import functionality for moving data, but it only pulls over the structure of a database, not the data itself. They also provided information on deploying collections and functions to a new Appwrite project using the Appwrite CLI. The user asked for help in understanding the logic of a function and provided YAML and JSON examples related to reducing product quantities in an order. They also asked for resources on learning how to implement functions. The
LDs_Group
1 Sep, 2023, 20:38

I just want to know if another method to create my table exist except admin panel

D5
1 Sep, 2023, 20:39

Yes, as said with appwrite functions

D5
1 Sep, 2023, 20:39

You can use any other server too with the server SDK if you want to create it externally

D5
1 Sep, 2023, 20:39

Also, you can create tables manually by connecting to MariaDB, but it's not recommended at all (that doesn't mean it's not possible)

LDs_Group
1 Sep, 2023, 20:40

Lastly, I have other question

LDs_Group
1 Sep, 2023, 20:42

I don't understand functions "How to Implement". Can you share a video link for function learning?

D5
1 Sep, 2023, 20:45

Yes

D5
1 Sep, 2023, 20:45
D5
1 Sep, 2023, 20:47

Also in any of the "modules" for example, databases, you can click the server tab and select your runtime/language and you will see the code that corresponds to functions and your language: https://appwrite.io/docs/server/databases

Same if you're going to use an independent server connected to appwrite. In other words, functions are basically server scripts

LDs_Group
1 Sep, 2023, 20:49

Let me take my laptop to send you a sample of that I want

D5
1 Sep, 2023, 20:51

Okay, perfect πŸ˜„

LDs_Group
1 Sep, 2023, 21:03
TypeScript
# TABLES
products:
    id
    name
    quantity

sales:
    id
    date
    amount

sale_items:
    id
    sale_id
    product_id
    quantity

I want function that reduce quantity of each product in the order on new order

TypeScript
// Create sale first
{
    "date": "2023-09-01" ,
    "amount": "100" ,
}
TypeScript
// Create sale items
[
    {
        "sale_id": 1 ,
        "product_id": 1 ,
        "quantity": 5 ,
    },
    {
        "sale_id": 1 ,
        "product_id": 3 ,
        "quantity": 10 ,
    },
]
LDs_Group
1 Sep, 2023, 21:13

I think that the response of that will help me to understand the logic of function

LDs_Group
4 Sep, 2023, 21:17

@D5

D5
4 Sep, 2023, 21:36

@LDs_Group I completely forgot about this. In the first place, sorry for the late response πŸ™

D5
4 Sep, 2023, 21:39

@LDs_Group What's your preferred language? JavaScript, Dart, PHP, Python Java...

ideclon
5 Sep, 2023, 23:55

DB ("Collections" in Appwrite) and Functions can be deployed to a new Appwrite project with the Appwrite CLI. You can pull the config of an existing project with $ appwrite init collection and $ appwrite init function, which will put it all into an appwrite.json file. You can then use $ appwrite deploy collection and $ appwrite deploy function to push them to a new project.

ideclon
5 Sep, 2023, 23:56

Note that this does only pull over the structure of a db, not any of it's data.

ideclon
5 Sep, 2023, 23:56

In Appwrite v1.4, there's now export/import functionality, which allows you to move over data, as well

Drake
6 Sep, 2023, 18:12

FYI, appwrite init function will create new functions. it won't pull the function from appwrite

LDs_Group
7 Sep, 2023, 20:18

JavaScript or dart was well

LDs_Group
8 Sep, 2023, 09:48

It looks like ?:

TypeScript
"collection": "a_collection",
"columnA": "string",
"columnB": "integer"
LDs_Group
13 Sep, 2023, 17:48

It's ok now, I found solution myself after long time of test 😦 but it's ok πŸ™‚

LDs_Group
13 Sep, 2023, 17:49

[Solved] Bulk create project on AppWrite

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more