Since you surely have to handle the case, that the limit is reached, I 
would define a constant value for the limit, stored in your model. Let's 
call MAX_DB_ENTRIES (=100). Then just check if the the limit is reached by if 
db(db.table.id>0).count() >= MAX_DB_ENTRIES: <inform the user of whatever 
the reaction should be>. Then you are independent on what database you use. 
I'm not sure if the solution fits your requirement. Does it?

Regards
Clemens

On Wednesday, October 14, 2020 at 4:42:05 PM UTC+2 Jim S wrote:

> I'm not entirely clear on what you're asking for.
>
> Are you trying to limit the number of records in a table in the database?
>
> If so, then I'd probably create a trigger on the database.  The way to do 
> that would be dependent on which database you are using.
>
> If not, can you explain a little more?
>
> -Jim
>
>
> On Tuesday, October 13, 2020 at 11:50:07 PM UTC-5, mostwanted wrote:
>>
>> Is there a way to limit the number of entries to a database?
>> Like limiting the number of entries to only 100 and nothing more.
>>
>> Regards;
>>
>> Mostwanted 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9239af54-7b8a-491c-9e0a-80d00555f1e2n%40googlegroups.com.

Reply via email to