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

:update syntax? #271

Open
vrn21 opened this issue Jul 3, 2024 · 3 comments
Open

:update syntax? #271

vrn21 opened this issue Jul 3, 2024 · 3 comments

Comments

@vrn21
Copy link

vrn21 commented Jul 3, 2024

I'm having a hard time, getting the syntax to remove one row from the db,

my schema

            :create Directory
            {
                uuid: String,
                name: String,
                parent: String,
                path: String,
                entry:String
            }
        }

        {
            :create File
            {
                uuid: String,
                name: String,
                parent: String,
                path: String,
                entry:String
            }
        }

and my remove syntax :

?[path] := *Directory{path},path='/Users/user/DummyDrive/child/child_of_child';
           :rm Directory{{uuid,name,parent,path,entry}}```
        
        
@vrn21
Copy link
Author

vrn21 commented Jul 5, 2024

np i had found how to do the same

  ?[uuid, name, parent, path,entry] := *Directory[uuid, name, parent, path,entry],path = 'some/path/
            :delete Directory{uuid, name, parent, path,entry}

but im still having some issue regarding :update

@vrn21 vrn21 changed the title :rm syntax? :update syntax? Jul 5, 2024
@creatorrr
Copy link
Contributor

what's the issue with update?

@vrn21
Copy link
Author

vrn21 commented Jul 30, 2024

i think i needed to add a key first,

i changed my schema to

        {
            :create Directory
            {
                uuid: String,
                =>
                name: String,
                parent: String,
                path: String,
                entry:String
            }
        }

        {
            :create File
            {
                uuid: String, =>
                name: String,
                parent: String,
                path: String,
                entry:String
            }
        }

    "
}

then this script worked

        ?[uuid,name] := uuid={},*Directory{{uuid}},name='{}'
        :update Directory{{uuid,name}}
        ```
        

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

No branches or pull requests

2 participants