Skip to content

Commit

Permalink
refactor: consistent err order
Browse files Browse the repository at this point in the history
  • Loading branch information
levydsa committed Oct 10, 2024
1 parent 5a56848 commit a831d9d
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions libsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

typedef struct libsql_error_t libsql_error_t;

typedef enum __attribute__((__packed__)
) { LIBSQL_CYPHER_DEFAULT = 0,
typedef enum {
LIBSQL_CYPHER_DEFAULT = 0,
LIBSQL_CYPHER_AES256,
} libsql_cypher_t;

typedef enum __attribute__((__packed__)
) { LIBSQL_TYPE_INTEGER = 1,
typedef enum {
LIBSQL_TYPE_INTEGER = 1,
LIBSQL_TYPE_REAL = 2,
LIBSQL_TYPE_TEXT = 3,
LIBSQL_TYPE_BLOB = 4,
LIBSQL_TYPE_NULL = 5,
} libsql_type_t;

typedef enum __attribute__((__packed__)
) { LIBSQL_TRACING_LEVEL_ERROR = 1,
typedef enum {
LIBSQL_TRACING_LEVEL_ERROR = 1,
LIBSQL_TRACING_LEVEL_WARN,
LIBSQL_TRACING_LEVEL_INFO,
LIBSQL_TRACING_LEVEL_DEBUG,
Expand Down Expand Up @@ -94,29 +94,29 @@ typedef struct {
} libsql_value_t;

typedef struct {
libsql_value_t ok;
libsql_error_t *err;
libsql_value_t ok;
} libsql_result_value_t;

typedef struct {
libsql_error_t *err;
uint64_t frame_no;
uint64_t frames_synced;
libsql_error_t *err;
} libsql_sync_t;

typedef struct {
libsql_error_t *err;
} libsql_bind_t;

typedef struct {
uint64_t rows_changed;
libsql_error_t *err;
uint64_t rows_changed;
} libsql_execute_t;

typedef struct {
libsql_error_t *err;
int64_t last_inserted_rowid;
uint64_t total_changes;
libsql_error_t *err;
} libsql_connection_info_t;

/**
Expand Down Expand Up @@ -168,8 +168,7 @@ libsql_batch_t
libsql_connection_batch(libsql_connection_t self, const char *sql);

/** Send a batch statement in a connection */
libsql_connection_info_t
libsql_connection_info(libsql_connection_t self);
libsql_connection_info_t libsql_connection_info(libsql_connection_t self);

/** Send a batch statement in a transaction */
libsql_batch_t
Expand Down

0 comments on commit a831d9d

Please sign in to comment.