Skip to content

Commit

Permalink
Rename odbc to sql everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
zinid committed Apr 20, 2016
1 parent fafeeb8 commit 1aae8a9
Show file tree
Hide file tree
Showing 47 changed files with 892 additions and 876 deletions.
40 changes: 20 additions & 20 deletions ejabberd.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ auth_method: internal
## extauth_program: "/path/to/authentication/script"

##
## Authentication using ODBC
## Authentication using SQL
## Remember to setup a database in the next section.
##
## auth_method: odbc
## auth_method: sql

##
## Authentication using PAM
Expand Down Expand Up @@ -330,26 +330,26 @@ auth_method: internal
##
## MySQL server:
##
## odbc_type: mysql
## odbc_server: "server"
## odbc_database: "database"
## odbc_username: "username"
## odbc_password: "password"
## sql_type: mysql
## sql_server: "server"
## sql_database: "database"
## sql_username: "username"
## sql_password: "password"
##
## If you want to specify the port:
## odbc_port: 1234
## sql_port: 1234

##
## PostgreSQL server:
##
## odbc_type: pgsql
## odbc_server: "server"
## odbc_database: "database"
## odbc_username: "username"
## odbc_password: "password"
## sql_type: pgsql
## sql_server: "server"
## sql_database: "database"
## sql_username: "username"
## sql_password: "password"
##
## If you want to specify the port:
## odbc_port: 1234
## sql_port: 1234
##
## If you use PostgreSQL, have a large database, and need a
## faster but inexact replacement for "select count(*) from users"
Expand All @@ -359,25 +359,25 @@ auth_method: internal
##
## SQLite:
##
## odbc_type: sqlite
## odbc_database: "/path/to/database.db"
## sql_type: sqlite
## sql_database: "/path/to/database.db"

##
## ODBC compatible or MSSQL server:
##
## odbc_type: odbc
## odbc_server: "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"
## sql_type: odbc
## sql_server: "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"

##
## Number of connections to open to the database for each virtual host
##
## odbc_pool_size: 10
## sql_pool_size: 10

##
## Interval to make a dummy SQL request to keep the connections to the
## database alive. Specify in seconds: for example 28800 means 8 hours
##
## odbc_keepalive_interval: undefined
## sql_keepalive_interval: undefined

###. ===============
###' TRAFFIC SHAPERS
Expand Down
4 changes: 2 additions & 2 deletions include/ejabberd_sql_pt.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

-define(SQL_UPSERT_MARK, sql_upsert__mark_).
-define(SQL_UPSERT(Host, Table, Fields),
ejabberd_odbc:sql_query(Host, ?SQL_UPSERT_MARK(Table, Fields))).
ejabberd_sql:sql_query(Host, ?SQL_UPSERT_MARK(Table, Fields))).
-define(SQL_UPSERT_T(Table, Fields),
ejabberd_odbc:sql_query_t(?SQL_UPSERT_MARK(Table, Fields))).
ejabberd_sql:sql_query_t(?SQL_UPSERT_MARK(Table, Fields))).

-record(sql_query, {hash, format_query, format_res, args, loc}).

Expand Down
2 changes: 1 addition & 1 deletion include/pubsub.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
%% note: pos_integer() should always be used, but we allow anything else coded
%% as binary, so one can have a custom implementation of nodetree with custom
%% indexing (see nodetree_virtual). this also allows to use any kind of key for
%% indexing nodes, as this can be usefull with external backends such as odbc.
%% indexing nodes, as this can be usefull with external backends such as sql.

-type(itemId() :: binary()).
%% @type itemId() = string().
Expand Down
18 changes: 9 additions & 9 deletions src/ejabberd_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,20 @@ get_commands_spec() ->
module = ejabberd_piefxis, function = export_host,
args = [{dir, string}, {host, string}], result = {res, rescode}},

#ejabberd_commands{name = export_odbc, tags = [mnesia, odbc],
#ejabberd_commands{name = export_sql, tags = [mnesia, sql],
desc = "Export all tables as SQL queries to a file",
module = ejd2odbc, function = export,
module = ejd2sql, function = export,
args = [{host, string}, {file, string}], result = {res, rescode}},
#ejabberd_commands{name = delete_mnesia, tags = [mnesia, odbc],
#ejabberd_commands{name = delete_mnesia, tags = [mnesia, sql],
desc = "Export all tables as SQL queries to a file",
module = ejd2odbc, function = delete,
module = ejd2sql, function = delete,
args = [{host, string}], result = {res, rescode}},
#ejabberd_commands{name = convert_to_scram, tags = [odbc],
#ejabberd_commands{name = convert_to_scram, tags = [sql],
desc = "Convert the passwords in 'users' ODBC table to SCRAM",
module = ejabberd_auth_odbc, function = convert_to_scram,
module = ejabberd_auth_sql, function = convert_to_scram,
args = [{host, binary}], result = {res, rescode}},

#ejabberd_commands{name = import_prosody, tags = [mnesia, odbc, riak],
#ejabberd_commands{name = import_prosody, tags = [mnesia, sql, riak],
desc = "Import data from Prosody",
module = prosody2ejabberd, function = from_dir,
args = [{dir, string}], result = {res, rescode}},
Expand All @@ -225,9 +225,9 @@ get_commands_spec() ->
module = ?MODULE, function = delete_old_messages,
args = [{days, integer}], result = {res, rescode}},

#ejabberd_commands{name = export2odbc, tags = [mnesia],
#ejabberd_commands{name = export2sql, tags = [mnesia],
desc = "Export virtual host information from Mnesia tables to SQL files",
module = ejd2odbc, function = export,
module = ejd2sql, function = export,
args = [{host, string}, {directory, string}],
result = {res, rescode}},
#ejabberd_commands{name = set_master, tags = [mnesia],
Expand Down
2 changes: 1 addition & 1 deletion src/ejabberd_auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ check_password(User, AuthzId, Server, Password, Digest,
%% where
%% AuthModule = ejabberd_auth_anonymous | ejabberd_auth_external
%% | ejabberd_auth_internal | ejabberd_auth_ldap
%% | ejabberd_auth_odbc | ejabberd_auth_pam | ejabberd_auth_riak
%% | ejabberd_auth_sql | ejabberd_auth_pam | ejabberd_auth_riak
-spec check_password_with_authmodule(binary(), binary(), binary(), binary()) -> false |
{true, atom()}.

Expand Down
4 changes: 2 additions & 2 deletions src/ejabberd_auth_internal.erl
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ export(_Server) ->
[{passwd,
fun(Host, #passwd{us = {LUser, LServer}, password = Password})
when LServer == Host ->
Username = ejabberd_odbc:escape(LUser),
Pass = ejabberd_odbc:escape(Password),
Username = ejabberd_sql:escape(LUser),
Pass = ejabberd_sql:escape(Password),
[[<<"delete from users where username='">>, Username, <<"';">>],
[<<"insert into users(username, password) "
"values ('">>, Username, <<"', '">>, Pass, <<"');">>]];
Expand Down
4 changes: 2 additions & 2 deletions src/ejabberd_auth_riak.erl
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ export(_Server) ->
[{passwd,
fun(Host, #passwd{us = {LUser, LServer}, password = Password})
when LServer == Host ->
Username = ejabberd_odbc:escape(LUser),
Pass = ejabberd_odbc:escape(Password),
Username = ejabberd_sql:escape(LUser),
Pass = ejabberd_sql:escape(Password),
[[<<"delete from users where username='">>, Username, <<"';">>],
[<<"insert into users(username, password) "
"values ('">>, Username, <<"', '">>, Pass, <<"');">>]];
Expand Down
Loading

0 comments on commit 1aae8a9

Please sign in to comment.