@@ -443,7 +443,7 @@ defmodule EctoLibSql.Native do
443443 {:ok, _} = EctoLibSql.Native.commit(state)
444444
445445 """
446- @ spec commit ( EctoLibSql.State . t ( ) ) :: { :ok , EctoLibSql.State . t ( ) } | { :error , term ( ) }
446+ @ spec commit ( EctoLibSql.State . t ( ) ) :: { :ok , String . t ( ) } | { :error , term ( ) }
447447 def commit (
448448 % EctoLibSql.State { conn_id: conn_id , trx_id: trx_id , mode: mode , sync: syncx } = _state
449449 ) do
@@ -460,7 +460,7 @@ defmodule EctoLibSql.Native do
460460 {:ok, _} = EctoLibSql.Native.rollback(state)
461461
462462 """
463- @ spec rollback ( EctoLibSql.State . t ( ) ) :: { :ok , EctoLibSql.State . t ( ) } | { :error , term ( ) }
463+ @ spec rollback ( EctoLibSql.State . t ( ) ) :: { :ok , String . t ( ) } | { :error , term ( ) }
464464 def rollback (
465465 % EctoLibSql.State { conn_id: conn_id , trx_id: trx_id , mode: mode , sync: syncx } = _state
466466 ) do
@@ -503,17 +503,28 @@ defmodule EctoLibSql.Native do
503503 String . downcase ( first_word )
504504 end
505505
506+ # DML commands - data manipulation.
506507 defp command_atom ( "select" ) , do: :select
507508 defp command_atom ( "insert" ) , do: :insert
508509 defp command_atom ( "update" ) , do: :update
509510 defp command_atom ( "delete" ) , do: :delete
511+
512+ # Transaction control commands.
510513 defp command_atom ( "begin" ) , do: :begin
511514 defp command_atom ( "commit" ) , do: :commit
512- defp command_atom ( "create" ) , do: :create
513515 defp command_atom ( "rollback" ) , do: :rollback
516+
517+ # DDL commands - schema modifications are grouped under :create since they
518+ # all modify database structure rather than data, and don't require distinct
519+ # handling in result processing.
520+ defp command_atom ( "create" ) , do: :create
514521 defp command_atom ( "drop" ) , do: :create
515522 defp command_atom ( "alter" ) , do: :create
523+
524+ # SQLite-specific.
516525 defp command_atom ( "pragma" ) , do: :pragma
526+
527+ # Catch-all for unrecognised commands.
517528 defp command_atom ( _ ) , do: :unknown
518529
519530 @ doc """
0 commit comments