Micha
Micha
CCConvex Community
Created by Micha on 4/19/2025 in #support-community
Error while running `npx convex dev` on mac - No loader is configured for ".node" files: fsevents
Great - that helped a lot thanks ❤️
6 replies
CCConvex Community
Created by Micha on 4/19/2025 in #support-community
Error while running `npx convex dev` on mac - No loader is configured for ".node" files: fsevents
This does not seem to solve it - the error stays unchanged. Added convex.json with
{
"node": {
"externalPackages": ["fsevents"]
}
}
{
"node": {
"externalPackages": ["fsevents"]
}
}
at the same level as my package.json. I've also installed fsevents to be double sure as a dependency, but it's also not making a difference.
6 replies
CCConvex Community
Created by kstulgys on 1/3/2025 in #support-community
Ents is in maintenance mode. Should I use it?
Security (ABAC) - written in FSL I love their simple yet powerful ABAC system - in my opinion, the best part of Fauna, because it makes security relatively easy.
role role_user {
privileges User {
read {
predicate (doc =>
doc == Query.identity()
)
}
write {
predicate ((oldDoc, newDoc) => {
oldDoc.emails == newDoc.emails &&
oldDoc.accounts == newDoc.accounts &&
oldDoc == Query.identity()
})
}
}

privileges createOrganization {
call {
//A user can only be part of 5 organizations to prevent organization abuse.
// Limit can be lifted if you have a specific use case.
predicate ((data) => {
Query.identity()!.organizations == null || Query.identity()!.organizations.length < 5
})
}
}


membership User {
predicate ( (doc) => isCalledWithAccessToken() )
}
}
role role_user {
privileges User {
read {
predicate (doc =>
doc == Query.identity()
)
}
write {
predicate ((oldDoc, newDoc) => {
oldDoc.emails == newDoc.emails &&
oldDoc.accounts == newDoc.accounts &&
oldDoc == Query.identity()
})
}
}

privileges createOrganization {
call {
//A user can only be part of 5 organizations to prevent organization abuse.
// Limit can be lifted if you have a specific use case.
predicate ((data) => {
Query.identity()!.organizations == null || Query.identity()!.organizations.length < 5
})
}
}


membership User {
predicate ( (doc) => isCalledWithAccessToken() )
}
}
14 replies
CCConvex Community
Created by kstulgys on 1/3/2025 in #support-community
Ents is in maintenance mode. Should I use it?
They had GraphQL support, but they dropped it in favor of their more powerful FQL language, which is inspired by JavaScript, Python, and GraphQL. Collections (Table) Written in a language file called fsl (fauna schema language). I appreciated the co-location of collection constraints, making it easy to understand a collection and its associated rules.
collection User {
firstName: String
...
compute emailVerification: String? = doc => { getVerificationEmail(doc.id)} // A field that will be resolved while fetching

compute roles: Array<String> = (user => currentRoles())
activeOrganization: Ref<Organization>?
organizations: Array<Ref<Organization>>?

// A check constraint ensures the created/updated/replaced data comply a specific shape
check isActiveOrganizationPartOfOrganizations ((user) => {
if(user.activeOrganization != null) {
user.organizations?.includes(user.activeOrganization)
} else {
true
}
})

check uniqueEmails (user => user.emails.length == user.emails.distinct().length)
unique [mva(.emails)]
check uniqueAccounts (user => user.accounts.length == user.accounts.distinct().length)
unique [mva(.accounts)]
}
collection User {
firstName: String
...
compute emailVerification: String? = doc => { getVerificationEmail(doc.id)} // A field that will be resolved while fetching

compute roles: Array<String> = (user => currentRoles())
activeOrganization: Ref<Organization>?
organizations: Array<Ref<Organization>>?

// A check constraint ensures the created/updated/replaced data comply a specific shape
check isActiveOrganizationPartOfOrganizations ((user) => {
if(user.activeOrganization != null) {
user.organizations?.includes(user.activeOrganization)
} else {
true
}
})

check uniqueEmails (user => user.emails.length == user.emails.distinct().length)
unique [mva(.emails)]
check uniqueAccounts (user => user.accounts.length == user.accounts.distinct().length)
unique [mva(.accounts)]
}
CRUD (Written in FQL - Fauna query language) I liked the short, but powerful syntax.
// Read
User.byId("123")
User.all()
User.first()

// They make it amazingly easy to filter based on or retrieve related ents
User.all().where((user) => user.activeOrganization.plan == "Pro")
User.first().activeOrganization

// Create
User.create({
firstName: "John"
})

// Delete
User.byId("123").delete()

// Update & Replace
User.byId("123").update({})
User.byId("123").replace({})

// Projection
User.first() {
firstName,
lastName,
primaryEmail
}
// Read
User.byId("123")
User.all()
User.first()

// They make it amazingly easy to filter based on or retrieve related ents
User.all().where((user) => user.activeOrganization.plan == "Pro")
User.first().activeOrganization

// Create
User.create({
firstName: "John"
})

// Delete
User.byId("123").delete()

// Update & Replace
User.byId("123").update({})
User.byId("123").replace({})

// Projection
User.first() {
firstName,
lastName,
primaryEmail
}
More queries: https://docs.fauna.com/fauna/current/reference/fql-api/cheat-sheet/
14 replies
CCConvex Community
Created by kstulgys on 1/3/2025 in #support-community
Ents is in maintenance mode. Should I use it?
Thanks for sharing—I will check it. The second article about SQL is probably not so relevant to me as I come from Fauna (their service is ending at the end of May—eventually, this is an opportunity for you to get more Fauna customers a new home 😉 ).
14 replies
CCConvex Community
Created by kstulgys on 1/3/2025 in #support-community
Ents is in maintenance mode. Should I use it?
Does that mean if I go now with Ents, I can expect some relevant migration later if you ship your own version as part of the convex core?
14 replies