@elizaos/core v1.0.0-beta.51 / IDatabaseAdapter
Interface: IDatabaseAdapter
Interface for database operations
Extended by​
Properties​
db​
db:
any
Database instance
Defined in​
packages/core/src/types.ts:776
Methods​
init()​
init():
Promise
<void
>
Initialize database connection
Returns​
Promise
<void
>
Defined in​
packages/core/src/types.ts:779
close()​
close():
Promise
<void
>
Close database connection
Returns​
Promise
<void
>
Defined in​
packages/core/src/types.ts:782
getAgents()​
getAgents():
Promise
<Partial
<Agent
>[]>
Get all agents
Returns​
Promise
<Partial
<Agent
>[]>
Defined in​
packages/core/src/types.ts:789
getEntityById()​
getEntityById(
entityId
):Promise
<Entity
>
Get entity by ID
Parameters​
• entityId: `${string}-${string}-${string}-${string}-${string}`
Returns​
Promise
<Entity
>
Defined in​
packages/core/src/types.ts:802
getEntitiesForRoom()​
getEntitiesForRoom(
roomId
,includeComponents
?):Promise
<Entity
[]>
Get entities for room
Parameters​
• roomId: `${string}-${string}-${string}-${string}-${string}`
• includeComponents?: boolean
Returns​
Promise
<Entity
[]>
Defined in​
packages/core/src/types.ts:805
createEntity()​
createEntity(
entity
):Promise
<boolean
>
Create new entity
Parameters​
• entity: Entity
Returns​
Promise
<boolean
>
Defined in​
packages/core/src/types.ts:808
updateEntity()​
updateEntity(
entity
):Promise
<void
>
Update entity
Parameters​
• entity: Entity
Returns​
Promise
<void
>
Defined in​
packages/core/src/types.ts:811
getComponent()​
getComponent(
entityId
,type
,worldId
?,sourceEntityId
?):Promise
<Component
>
Get component by ID
Parameters​
• entityId: `${string}-${string}-${string}-${string}-${string}`
• type: string
• worldId?: `${string}-${string}-${string}-${string}-${string}`
• sourceEntityId?: `${string}-${string}-${string}-${string}-${string}`
Returns​
Promise
<Component
>
Defined in​
packages/core/src/types.ts:814
getComponents()​
getComponents(
entityId
,worldId
?,sourceEntityId
?):Promise
<Component
[]>
Get all components for an entity
Parameters​
• entityId: `${string}-${string}-${string}-${string}-${string}`
• worldId?: `${string}-${string}-${string}-${string}-${string}`
• sourceEntityId?: `${string}-${string}-${string}-${string}-${string}`
Returns​
Promise
<Component
[]>
Defined in​
packages/core/src/types.ts:822
createComponent()​
createComponent(
component
):Promise
<boolean
>
Create component
Parameters​
• component: Component
Returns​
Promise
<boolean
>
Defined in​
packages/core/src/types.ts:825
updateComponent()​
updateComponent(
component
):Promise
<void
>
Update component
Parameters​
• component: Component
Returns​
Promise
<void
>
Defined in​
packages/core/src/types.ts:828
deleteComponent()​
deleteComponent(
componentId
):Promise
<void
>
Delete component
Parameters​
• componentId: `${string}-${string}-${string}-${string}-${string}`
Returns​
Promise
<void
>
Defined in​
packages/core/src/types.ts:831
getMemories()​
getMemories(
params
):Promise
<Memory
[]>
Get memories matching criteria
Parameters​
• params
• params.entityId?: `${string}-${string}-${string}-${string}-${string}`
• params.agentId?: `${string}-${string}-${string}-${string}-${string}`
• params.count?: number
• params.unique?: boolean
• params.tableName: string
• params.start?: number
• params.end?: number
• params.roomId?: `${string}-${string}-${string}-${string}-${string}`
• params.worldId?: `${string}-${string}-${string}-${string}-${string}`
Returns​
Promise
<Memory
[]>
Defined in​
packages/core/src/types.ts:834
createRelationship()​
createRelationship(
params
):Promise
<boolean
>
Creates a new relationship between two entities.
Parameters​
• params
Object containing the relationship details
• params.sourceEntityId: `${string}-${string}-${string}-${string}-${string}`
• params.targetEntityId: `${string}-${string}-${string}-${string}-${string}`
• params.tags?: string
[]
• params.metadata?
Returns​
Promise
<boolean
>
Promise resolving to boolean indicating success
Defined in​
packages/core/src/types.ts:951
updateRelationship()​
updateRelationship(
relationship
):Promise
<void
>
Updates an existing relationship between two entities.
Parameters​
• relationship: Relationship
The relationship object with updated data
Returns​
Promise
<void
>
Promise resolving to void
Defined in​
packages/core/src/types.ts:963
getRelationship()​
getRelationship(
params
):Promise
<Relationship
>
Retrieves a relationship between two entities if it exists.
Parameters​
• params
Object containing the entity IDs and agent ID
• params.sourceEntityId: `${string}-${string}-${string}-${string}-${string}`
• params.targetEntityId: `${string}-${string}-${string}-${string}-${string}`
Returns​
Promise
<Relationship
>
Promise resolving to the Relationship object or null if not found
Defined in​
packages/core/src/types.ts:970
getRelationships()​
getRelationships(
params
):Promise
<Relationship
[]>
Retrieves all relationships for a specific entity.
Parameters​
• params
Object containing the user ID, agent ID and optional tags to filter by
• params.entityId: `${string}-${string}-${string}-${string}-${string}`
• params.tags?: string
[]
Returns​
Promise
<Relationship
[]>
Promise resolving to an array of Relationship objects