[Ur] Multitenancy

2018-05-13 Thread Simon Van Casteren
Hi, I'm in the process of making a new application for music schools, using ur/web for front and backend. I'm at the point where I have two customers and am starting to implement support for multiple clients/tenants in one DB (postgres). I've been planning to implement multitenancy from the

Re: [Ur] Multitenancy

2018-05-13 Thread Simon Van Casteren
, or complicating the deployment with seperate apps. 2018-05-13 15:31 GMT+02:00 Adam Chlipala <ad...@csail.mit.edu>: > Can you explain why you don't want to run separate applications with > separate databases? > > > On 05/13/2018 05:50 AM, Simon Van Casteren wrote: > > Hi, > > I

Re: [Ur] Multitenancy

2018-05-13 Thread Simon Van Casteren
produces for an application. All of the details are independent >> of application specifics. >> >> I am not aware of any existing tools for doing these simple steps >> automatically, but it should be easy to roll an all-inclusive shell script. >> >> On 05/13/

Re: [Ur] Reading files uploaded by a user

2018-08-12 Thread Simon Van Casteren
stable, but that might take a while. My whole application is in Dutch at the moment, but I'm definitely planning to translate it to English as well. It will all come, but will take some more time :). Simon Op za 11 aug. 2018 om 22:54 schreef Adam Chlipala : > On 08/11/2018 04:34 PM, Simon

[Ur] Reading files uploaded by a user

2018-08-11 Thread Simon Van Casteren
Hey everybody, Does anybody have experience with reading files uploaded by a user in Ur/Web? My use case: I'm building an application used by (music) schools and migrating their data into my database is a big thing. Medium-sized schools often have more than 1000 students following classes, so

[Ur] Struggling to figure out mapping of record

2018-08-18 Thread Simon Van Casteren
Hi everybody, I'm struggling to get my validation functions the way I really like them. What I would like to do is start from a record of input fields that have a certain type, eg: {Age: option float, FirstName: string} I then have a function that will validate the values of this record, and

Re: [Ur] calling javascript code in

2018-07-05 Thread Simon Van Casteren
This is a very cool trick! I happened to need this: I'm making a filtering page with a ton of checkboxes, and every time I check any one of them, I want to reload stuff from the server. My first solution was to add my "reloadStuff" function in every onchange handler of every checkbox. I've now

[Ur] Property-based testing + Contract driven development

2018-07-09 Thread Simon Van Casteren
Hey, My current urweb project is getting quite big and there's a few places where property-based testing would be very handy. I've not found anything online though that can do this for urweb. Is anybody working on this? Porting Quickcheck or one of its derivatives from Haskell or PureScript would

Re: [Ur] Property-based testing + Contract driven development

2018-11-03 Thread Simon Van Casteren
rested in making testing easy > to do in Ur/Web. > > On Mon, Jul 9, 2018, 2:52 PM Simon Van Casteren < > simon.van.caste...@gmail.com> wrote: > >> Hey, >> >> My current urweb project is getting quite big and there's a few places >> where property-based t

Re: [Ur] Tooling: type of an expression

2018-10-24 Thread Simon Van Casteren
02:56 AM, Simon Van Casteren wrote: > > I think that would get me to the first level: getting types of > identifiers. Do you see any way to evaluate expressions and getting the > types of those? > > This is something that would definitely be worth it for me, so I'll be > impleme

[Ur] Tooling: type of an expression

2018-10-10 Thread Simon Van Casteren
Urweb tooling is pretty limited compared to other languages. I knew that when I started with it and so far I'm OK with it. Honestly, most of the "modern" tooling I see in other ecosystems is a waste of time. However, the one thing that would really cut dev time in half for me in Ur/web (slightly

Re: [Ur] Tooling: type of an expression

2018-10-11 Thread Simon Van Casteren
odically run "compiles" through type > inference, saving the results to hidden files. > > On 10/10/2018 08:22 PM, Simon Van Casteren wrote: > > Urweb tooling is pretty limited compared to other languages. I knew > > that when I started with it and so far I'm OK with it.

[Ur] Securing sessions in Ur/Web

2019-01-18 Thread Simon Van Casteren
Hey, I've been thinking about this the better part of the day, but I can't figure out the right approach here. When a person logs in, username-password style, I make a cookie with this form: { Role: , Email: string , CreatedOn: time} I'm saving the role in the cookie, so subsequent security

Re: [Ur] Securing sessions in Ur/Web

2019-01-20 Thread Simon Van Casteren
gt; On 1/18/19 10:14 AM, Simon Van Casteren wrote: > > When a person logs in, username-password style, I make a cookie with this > form: > > { Role: > , Email: string > , CreatedOn: time} > > I'm saving the role in the cookie, so subsequent security checks in the >

[Ur] SQL table.field IN list

2019-01-12 Thread Simon Van Casteren
Hi, Am I correct in thinking that the standard library/compiler doesn't support SQL "IN" statements? It's something that I use a lot in my programs, and in psql for example you can just do: SELECT * FROM uw_lesson_lessons WHERE uw_id in (1, 2, 3) I made my own function to handle this, using a

Re: [Ur] Mandatory nginx conf: merge_slashes off

2019-01-26 Thread Simon Van Casteren
s only for strings. Would it be worth changing > [unit] serialization to avoid empty serializations there, too? > > On 1/25/19 8:21 AM, Simon Van Casteren wrote: > > It doesn't happen often of course, since you rarely use unit in a page or > RPC function. How I ran into it was ac

[Ur] Mandatory nginx conf: merge_slashes off

2019-01-25 Thread Simon Van Casteren
Hi, I just ran into an awful problem combining urweb with nginx. By default, nginx by default merges double slashes in urls, eg: http://www.bla.com//users becomes http//www.bla.com/users. This can be a problem for UrWeb applications since a double slash is actually how urweb encodes the unit or

Re: [Ur] Mandatory nginx conf: merge_slashes off

2019-01-25 Thread Simon Van Casteren
er making a special > effort to encode empty strings with underscores, precisely to avoid this > problem (though it was appearing in Apache, if I recall correctly). Can > you point us to an example where it arises, in a URL that an Ur/Web app > generates itself? > > On 1/25/19 5:13

Re: [Ur] Explicitly asking for a sql rollback

2019-02-03 Thread Simon Van Casteren
Yeah I figured that would cause more problems than it would solve but still glad I asked. I might rewrite my import like you said. It is a better way of doing things. Thanks! On Sun, Feb 3, 2019, 3:14 PM Adam Chlipala On 2/3/19 7:54 AM, Simon Van Casteren wrote: > > About your first c

[Ur] Explicitly asking for a sql rollback

2019-02-03 Thread Simon Van Casteren
Hey, I'm wondering if there is a way to explicitly ask for a sql rollback. I think the only way you can now trigger a rollback would be by calling the "error" function and providing an xbody. I have two use cases for which I think an explicit rollback mechanism (not sure how that would look

Re: [Ur] Explicitly asking for a sql rollback

2019-02-03 Thread Simon Van Casteren
doing now. It's OK, but it's a bit slower and a bit more heavy handed. I'm ok with it though, I would still use the rolback operation here as well though, if it was available. It's not necessary though. Simon On Sun, Feb 3, 2019, 1:29 PM Adam Chlipala On 2/3/19 5:24 AM, Simon Van Casteren wrote

Re: [Ur] Joining Nullable to Non-nullable fields

2019-06-07 Thread Simon Van Casteren
l > > Cheers > > On Thu, Jun 6, 2019, 13:56 Simon Van Casteren < > simon.van.caste...@gmail.com> wrote: > >> Hey everybody, >> >> Something that's been bothering me for some time now. Is it possible to >> OUTER JOIN a nullable field to a non-nullable field? I

[Ur] Joining Nullable to Non-nullable fields

2019-06-06 Thread Simon Van Casteren
Hey everybody, Something that's been bothering me for some time now. Is it possible to OUTER JOIN a nullable field to a non-nullable field? I keep getting type errors and can't figure out how to tell the compiler he should only do the join for the records that the nullable field is non-null...

[Ur] Pre-compressing static assets

2019-05-21 Thread Simon Van Casteren
Hey everybody, I've been breaking my head today on how to do pre-compression of static assets, mainly the app.*.js bundle. Currently I'm having Nginx do on-the-fly compression using brotli at lvl 4. This causes my app.*.js bundle to shrink from 1.8 MB to 145 kB. This is really good already, but

Re: [Ur] Pre-compressing static assets

2019-05-21 Thread Simon Van Casteren
ternal program > to run to transform this JavaScript code. > > On 5/21/19 9:05 AM, Simon Van Casteren wrote: > > Hey everybody, > > > > I've been breaking my head today on how to do pre-compression of > > static assets, mainly the app.*.js bundle. Currently I'm having Ng

Re: [Ur] Blogpost

2020-04-28 Thread Simon Van Casteren
That's interesting! I'm gonna give that a try and see what happens. Simon On Mon, 27 Apr 2020, 14:36 Vladimir Shabanov, wrote: > In case anyone is interested, I wrote a blog post some time ago about my > experiences with Ur/Web. > > http://frigoeu.github.io/urweb1.html > > > Great post. I

[Ur] Blogpost

2020-04-27 Thread Simon Van Casteren
Hi everybody, In case anyone is interested, I wrote a blog post some time ago about my experiences with Ur/Web. http://frigoeu.github.io/urweb1.html Simon ___ Ur mailing list Ur@impredicative.com

Re: [Ur] Blogpost

2020-04-30 Thread Simon Van Casteren
d-memory-efficient. > > You also have an example of queryL1 followed by List.mapM. I would just > use queryI1 there. > > On 4/27/20 2:28 AM, Simon Van Casteren wrote: > > Hi everybody, > > > > In case anyone is interested, I wrote a blog post some time ago

Re: [Ur] Change grammar to swap precedence of "&&" and "||"?

2020-05-16 Thread Simon Van Casteren
All good. I mostly write this stuff with parentheses anyway. Op za 16 mei 2020 om 01:08 schreef Ace : > Strongly agree with this change > > On Fri, May 15, 2020, 11:59 Ziv Scully wrote: > >> Strong vote in favor of this change. (In Ur/Web code I've written, this >> change would either be a

Re: [Ur] Any interest in bringing up a platform for virtual conferences?

2020-03-22 Thread Simon Van Casteren
I'm also interested. I've been thinking about video conf and recordings for my music school application (www.classy.school), and it's just a really good thing to have integrated into any app. So I'd be interested in doing some work for it. (How much is always the issue of course... Especially now

[Ur] Better date & time support in Ur/Web + PostgreSQL

2020-08-16 Thread Simon Van Casteren
I've been building www.classy.school for some time with Ur/Web now. It's an application for music schools and a lot of it revolves around schedules: Who has lessons at what time, which teacher, which room, etc etc. In Ur/Web's "standard library" there are 2 types to represent dates / times: -