![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@saulx/selva
Advanced tools
🌴 Selva is a realtime undirected acyclic graph database.
Takes an object with options
example
import { getService } from 'registry'
const client = selva.connect(() => getService('name-of-db'))
// client.redis.hget()
client.set('myId', { myShine: true }).then((result) => console.log(result)) // logs OK
const client = selva.connect({
port: 8080,
host: 'whatever', // defaults to localhost
retryStrategy() {
// optional
return 5e3
},
})
or with a promise
const client = selva.connect(new Promise(resolve => {
resolve({
port: 8080,
host: 'whatever',
retryStrategy () {
return 5e3
}
})
})
or with a (async) function
const client = selva.connect(async () => {
await doSomething()
return {
port: 8080,
host: 'whatever',
retryStrategy() {
return 5e3
},
}
})
On every reconnect selva will call the given function. This allows you to change the configuration (eg. if a db has become unresponsive).
Set an object on an id. Will deep merge objects by default.
Default behaviours
await client.set({
$id: 'myId',
$merge: false, // defaults to true
$version: 'mySpecialversion', // optional
id: 'myNewId',
foo: true,
})
await client.set({
$id: 'myId',
$merge: false, // defaults to true
$version: 'mySpecialversion', // optional
id: 'myNewId',
foo: true,
children: {
$add: 'smukytown',
$delete: 'myblarf',
},
})
await client.set({
$id: 'myId',
children: {
// maybe redis SET do it?
// ---- :(
$hierarchy: false, // defaults to true
$add: 'smukytown',
$delete: ['myblarf', 'xxx'],
},
})
await client.set({
$id: 'myId',
children: {
// ---- :(
$hierarchy: false, // defaults to true
$value: ['root'],
},
})
await client.set({
// gen id, add to root
type: 'tag',
title: 'flowers',
externalId: 'myflower.de'
}
})
await client.set({
// gen id, add to root
type: 'tag',
title: 'flowers',
externalId: {
$merge: false,
$value: 'myflower.de',
},
})
await client.set({
type: 'tag',
title: { de: 'blümen' },
})
await client.set({
$id: 'myId',
$merge: false, // defaults to true
$version: 'mySpecialversion', // optional
myThing: {
title: 'blurf',
nestedCount: {
$default: 100,
$inc: { $value: 1 },
},
access: {
$default: {
flurpiepants: 'my pants',
},
},
},
})
myId
myId#mySpecialversion
const result = await client.get(
{
$id: 'myId',
$version: 'mySpecialversion'
}
)
const versioned = redisClient.get('myId#mySpecialversion')
const original = redisClient.get('myId') || {}
const result = { ...original, ...versioned }
myId
myId#mySpecialversion
const obj = {
foo: {
bar: true,
},
haha: true,
}
'foo.bar': true
'foo.foo': true
'foo.baz': true
'foo.baz.blarf': true,
haha: true
hkeys: foo.*
{ foo: true }
const result = await client.subscribe(
{
id: 'myId',
version: 'mySpecialversion', // optional
},
(id, msg) => {
console.log(`Fired for ${id} with message: ${msg}`)
}
)
const result = await client.subscribe(
{
id: 'myId',
date: 123123123,
version: 'mySpecialversion', // optional
},
(id, msg) => {
console.log(`Fired for ${id} with message: ${msg}`)
}
)
or with an array for ids
const result = await client.subscribe(
{
id: ['myId', 'myOtherId'],
version: 'mySpecialversion', // optional
},
(id, msg) => {
console.log(`Fired for ${id} with message: ${msg}`)
}
)
const result = await client.unsubscribe(
{
id: 'myId',
version: 'mySpecialversion', // optional
},
myCallback // if omitted will remove all listeners
)
Generate an id
Max types 1764!
const id = await client.id({ type: 'flurpy', externalId: 'smurkysmurk' })
// flgurk
await client.delete('ma12231')
await client.delete({ $id: 'ma12231' })
await client.delete({ $id: 'ma12231', $hierarchy: false })
FAQs
🌴 Selva is a realtime undirected acyclic graph database.
The npm package @saulx/selva receives a total of 60 weekly downloads. As such, @saulx/selva popularity was classified as not popular.
We found that @saulx/selva demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.