DeleteAccount deletes a specific account from the database. It removes the account with the given account ID from the accounts table. Parameters: - id: The unique ID of the account to be deleted. Returns: - An error if the deletion fails, otherwise returns nil.
(id string)
| 355 | // Returns: |
| 356 | // - An error if the deletion fails, otherwise returns nil. |
| 357 | func (d Datasource) DeleteAccount(id string) error { |
| 358 | // Execute the SQL delete statement |
| 359 | _, err := d.Conn.ExecContext(context.Background(), ` |
| 360 | DELETE FROM ledgerforge.accounts WHERE account_id = $1 |
| 361 | `, id) |
| 362 | |
| 363 | // Return any errors encountered during the deletion |
| 364 | return err |
| 365 | } |
| 366 | |
| 367 | // GetAllAccountsWithFilter retrieves accounts with advanced filtering support. |
| 368 | // It delegates to GetAllAccountsWithFilterAndOptions with nil options. |
no outgoing calls