You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: db_insert.m
    path of file: ./repos/fecgsyn/subfunctions/data-generation/libs/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function db_insert(tablename, s)

% DB_INSERT inserts a structure into a database table. Each field of
% the structure should correspond with one of the fields in the table.
%
% Use as
%   db_insert(tablename, s)

% Copyright (C) 2007, Robert Oostenveld
%
% $Log: db_insert.m,v $
% Revision 1.2  2007/12/03 12:35:24  roboos
% fixed bug when input is double([])
%
% Revision 1.1  2007/11/07 10:50:46  roboos
% created helper functions for easy access to a MySQL database table using a structure for representing the data
%

if isempty(s)
  % the input consists of an empty structure. so nothing to do
  return

    
function db_insert(tablename, s)

% DB_INSERT inserts a structure into a database table. Each field of
% the structure should correspond with one of the fields in the table.
%
% Use as
%   db_insert(tablename, s)

% Copyright (C) 2007, Robert Oostenveld
%
% $Log: db_insert.m,v $
% Revision 1.2  2007/12/03 12:35:24  roboos
% fixed bug when input is double([])
%
% Revision 1.1  2007/11/07 10:50:46  roboos
% created helper functions for easy access to a MySQL database table using a structure for representing the data
%

if isempty(s)
  % the input consists of an empty structure. so nothing to do
  return
end

f  = fieldnames(s);
v = {};
t = {};
l = length(f);
for i=1:l
  v{i} = getfield(s, f{i});
  t{i} = class(v{i});
end