File tree 2 files changed +10
-14
lines changed
2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -326,10 +326,8 @@ function restrict(self, varargin)
326
326
for arg = varargin
327
327
if iscell(arg{1 })
328
328
self .restrict(arg{1 }{: })
329
- end
330
- % unless duplicate, append restriction
331
- if ~any(cellfun(@(x ) isequal(arg{1 },x ), self .restrictions ))
332
- self.restrictions = [self .restrictions arg{1 }];
329
+ else
330
+ self.restrictions = [self .restrictions arg(1 )];
333
331
end
334
332
end
335
333
end
@@ -346,11 +344,8 @@ function restrict(self, varargin)
346
344
% tp.Scans & struct('mouse_id',3, 'scannum', 4);
347
345
% tp.Scans & 'lens=10'
348
346
% tp.Mice & (tp.Scans & 'lens=10')
349
- if ~iscell(arg )
350
- arg = {arg };
351
- end
352
347
ret = self .copy ;
353
- ret.restrictions = [ ret . restrictions arg ];
348
+ ret .restrict( arg )
354
349
end
355
350
356
351
function ret = or(self , arg )
@@ -406,7 +401,7 @@ function restrict(self, varargin)
406
401
' Antijoin only accepts single restrictions' ))
407
402
end
408
403
ret = self .copy ;
409
- ret.restrictions = [ret.restrictions { ' not' arg }];
404
+ ret .restrict( ' not' , arg )
410
405
end
411
406
412
407
function ret = pro(self , varargin )
Original file line number Diff line number Diff line change @@ -493,11 +493,12 @@ function reload(self, force)
493
493
% reload schema information into memory: table names and field named.
494
494
fprintf(' loading table definitions from %s ... ' , self .dbname )
495
495
tic
496
- self.tables = self .conn .query(sprintf([...
497
- ' SELECT table_name AS name, table_comment AS comment ' ...
498
- ' FROM information_schema.tables ' ...
499
- ' WHERE table_schema="%s " AND table_name REGEXP "{S}"' ], ...
500
- self .dbname ),self .tableRegexp );
496
+ self.tables = self .conn .query(sprintf(...
497
+ ' SHOW TABLE STATUS FROM `%s ` WHERE name REGEXP "{S}"' , ...
498
+ self .dbname ),self .tableRegexp ,' bigint_to_double' );
499
+ self.tables.name = self .tables .Name ;
500
+ self.tables.comment = self .tables .Comment ;
501
+ self.tables = dj .struct .pro(self .tables ,' name' ,' comment' );
501
502
502
503
% determine table tier (see dj.Table)
503
504
re = cellfun(@(x ) sprintf(' ^%s%s [a-z][a-z0-9_]*$' ,self .prefix ,x ), ...
You can’t perform that action at this time.
0 commit comments